Git Product home page Git Product logo

restaurant_success_model's Introduction

Project: Restaurant Success Model

A model that predicts if a restaurant is likely to close within the next 4 years.

Project Description

The goal of this project was to built a model that can predict whether a restaurant is likely to close within a 4-year period. This information would be useful to restaurant lenders (such as banks) and investors.

To achieve the above goal I started by building a relevant dataset which I then used to fit a logistic regression algorithm that can separate between restaurants that are likely to close and restaurants that are likely to remain open. Building a meaningful dataset involved several steps that are breaken down below:

  1. Find an initial list of restaurants that used to exist in the past.
  2. Find information about the current state of the restaurants from the past. a) Pull information from the Yelp Search API. b) Check if the information is correct (restaurant names and addresses have changed in 4 years). c) Find additional information about non-matched restaurants using the Google Search API. d) Pull new information from Yelp Business API using the web addresses found through Google. e) Match information from old and new datasets to make sure it is correct.
  3. Engineer relevant features.
  4. Test different Machine Learning models and optimize parameters based on above use case.

The work described in the above steps is split in five Jupyter notebooks.

Code

All code is presented in a series of notebooks showing the steps followed for each of the individual processes and the resulting numbers and graphs.

This repository includes the code to pull data from the Yelp Search API, based on the names and addresses of the restaurants found on a Yelp Kaggle Dataset released in 2013.

The data from the two sources (Yelp Search API and Kaggle) are matched to guarantee the consistency between the two sets and only 65% of the entries had a matching address and name. The Google Custom Search API is used for the unmatched data to find the right restaurant urls (file: Restaurants_yelp_GoogleCustomSearchAPI.ipynb) and pull the remaining data using the Yelp Business API (file: Restaurants_yelp_API_for_GoogleSearchResults.ipynb).

The two datasets are then matched together with higher success rate (file: Restaurants_yelp_join_all.ipynb) and the resulting dataframe is used to generate additional features (file: Restaurants_yelp_more_features_final.ipynb).

Different ML algorithms are fitted using the above features Logistic Regression and Gradient Boosting being the most successful (file: Restaurants_yelp_ML_final.ipynb).

For a more detailed discussion of the process followed to develop this model and the obtained results, see the relevant blog post.

restaurant_success_model's People

Contributors

alifier 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.