Giter Site home page Giter Site logo

yelpanalysis's Introduction

yelpAnalysis

LAB 4 In this lab, you will learn how to solve problems using Map Reduce. You will use Hadoop map-reduce to derive some statistics from Yelp Dataset. The dataset files are located in HDFS in the following path, /yelp/business/business.csv /yelp/review/review.csv /yelp/user/user.csv If somehow the files disappear from the above HDFS location, you can also download them from: http://www.utdallas.edu/~axn112530/cs6350/yelp/ Dataset Description. The dataset comprises of three csv files, namely user.csv, business.csv and review.csv. Note that some of the content, such as id fields are encoded. Note that the files are separated by "^" character.

  1. Business.csv file contain basic information about local businesses. Business.csv file contains the following columns "business_id","full_address","categories" 'business_id': (a unique identifier for the business) 'full_address': (localized address), 'categories': [(localized category names)]

  2. Review.csv file contains the star rating given by a user to a business. Use user_id to associate this review with others by the same user. Use business_id to associate this review with others of the same business. review.csv file contains the following columns "review_id","user_id","business_id","stars" 'review_id': (a unique identifier for the review) 'user_id': (the identifier of the reviewed business), 'business_id': (the identifier of the authoring user), 'stars': (star rating, integer 1-5),the rating given by the user to a business

  3. user.csv file contains aggregate information about a single user across all of Yelp user.csv file contains the following columns "user_id","name","url" user_id': (unique user identifier), 'name': (first name, last initial, like 'Matt J.'), this column has been made anonymous to preserve privacy 'url': url of the user on yelp

Q1. For all the businesses that are located in “Palo Alto”, output their full address and also how many businesses are in each address. You can use the full_address column as the filter column. (An example of how to do this is in the file CountYelpBusiness.java).

Q2. Modify Q1 to output business id and full_address of Restaurants that are located in the state of NY.

Q3. You would like to find the top 10 zip codes where the most businesses are located. To accomplish this, you will emit the following (K,V) pair from mapper (ZipCode, 1). Then in the reducer, you will sort by the value and emit the top 10 elements. Example code for the topN values for the wordcount problem is given in the class TopN. You can get some hints from that class.

Q4. Find the top ten rated businesses using the average ratings. Recall that star column in review.csv file represents the rating. Please answer the question by calculating the average ratings given to each business using the review.csv file. You can reuse part of the logic for sorting by values from Q3. Sample Output: eebUeWSJDlmtz80tT2kDuA 5.0 H7VLT9-UbaDVKbxfLAMqwg 5.0 dLJgjRFphvHoQQsC9tEyTQ 5.0 5.0

Q5. Modify Q4 to find out the 10 businesses that have received the lowest average ratings. * Hint: You just have to output hashmap in reverse order and stop at counter value of 10 *

yelpanalysis's People

Contributors

bobbyhuang326 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.