Code Monkey home page Code Monkey logo

yelp-heat-map's Introduction

yelp-heat-map

MapReduce algorithm for Yelp's Academic Dataset to create a geographic heatmap of a word

The goal of this analysis is to show which words occur frequently at a particular geographic region. The output is a HeatMap that shows the frequency at which any arbitrary word occurs at a particular latitude and longitude. In order to display that HeatMap, for each word, we need a list of all the coordinates that the word appears at and the number of times it appears there. The table below shows the MapReduce data flow to get the list of geographic coordinates at which a single word appears:

Mapper In Mapper Output/Reducer Input Reducer Output
Review JSON structure Each time the desired word is found, produce
Key(String): Business_ID
Value (IntWritable):1
Key(String):[latitude, longitude]
Value(IntWritable) :frequency

Currently has been tested using the JSON data for reviews and business provided by Yelp here: https://www.yelp.com/academic_dataset

To run the program, you'll also need to get the json-simple library and pass it as a param to libjars.

hadoop jar <built_solution.jar>  solution.WordCount -libjars=< path to simple json> /json-simple-1.1.1.jar  -D wc.business.file=< path to business json file>  < path to review files directory>  < outputdir>

The output is a format easily consumable by google heatmaps api. See https://developers.google.com/maps/documentation/javascript/heatmaplayer

yelp-heat-map's People

Contributors

meskolin avatar

Watchers

James Cloos avatar DataEdge Syatems Inc. 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.