/zomato-restaurant-clustering-and-sentiment-analysis

Build machine learning models to cluster the restaurants into different segments and analyze the sentiments of the reviews given by the customers.

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Banner Link to deployed model: http://sentimenent-analysis-zomato-review.ap-south-1.elasticbeanstalk.com/

In this project, I have attempted to analyze the metadata and reviews of popular restaurants in Hyderabad and build machine learning models to cluster the restaurants into different segments based on cuisines and analyze the sentiments of the reviews given by the customers.

💾 Project Files Description

This project contains an executable iPython Notebook, a presentation and source as follows:

Executable Files:

  • Zomato_Restaurant_Clustering_and_Sentiment_Analysis.ipynb - Google Colab notebook containing data summary, exploration, visualisations, feature engineering, text processing, modelling, performance evaluation and conclusion.

Documentation:

  • Presentation PDF - Unsupervised Machine Learning - Zomato Restaurant Clustering and Sentiment Analysis - Capstone Project.pdf - Presentation slideshow of the project.

Source Directory:

  • Data & Resources.zip - Includes metadata and review data of restaurants listed by Zomato in Hyderabad.

📖 Problem Statement

Zomato is an Indian restaurant aggregator and food delivery start-up founded by Deepinder Goyal and Pankaj Chaddah in 2008. Zomato provides information, menus, and user-reviews of restaurants, and also has food delivery options from partner restaurants in select cities. The main objective is to understand the existing data and analyze their trends and patterns, so that machine learning models can be built, one for segmentation of restaurant types and another for sentiment analysis of reviews.

📖 Approach

  1. Understanding the business task.
  2. Reading data from files given and providing a summary.
  3. Data cleaning, which involves removing irregularities in the data.
  4. Exploratory data analysis, to find which factors affect sales and how they affect it.
  5. Feature engineering, to prepare data for modelling.
  6. Text Processing, to convert text to numeric data for modelling.
  7. Modelling data (for both clustering and sentiment analysis) and comparing the models to find out the most suitable one for forecasting.
  8. Conclusion.

📖 Exploratory Data Analysis

The following insights were gained from EDA:

  • Collage - Hyatt Hyderabad Gachibowli is the most expensive restaurant and Mohammedia Shawarma, and Amul are the most affordable ones.
  • North Indian cuisine is the most popular cuisine.
  • Anvesh Chowdary is the most experienced reviewer while Satwinder Singh is the most popular one.
  • AB's - Absolute Barbecues is the highest rated restaurant.
  • Some linear relationship exists between the average rating of restaurants and the cost of food.
  • 📖 Modelling

    🖨️ Restaurant Clustering Based on Cuisines

    💹 Clusters by K Means Algorithm

    Result

    💹 Clusters by DBSCAN Algorithm

    Result

    🖨️ Restaurant Clustering Based on Cost and Rating

    💹 Clusters by K Means Algorithm

    Result

    💹 Clusters by DBSCAN Algorithm

    Result

    🖨️ Modelling for Sentiment Analysis

    💹 Comparison of Models

    Result

    💹 Performance of Model after Hyperparameter Tuning

    Result

    Result

    Result

    📖 Deployment

  • A web application is built to demonstrate the working of the trained machine learning model using a combination of HTML, CSS, and JavaScript.
  • The prediction of sales using the trained ML model is carried out via a Flask API.
  • This web application is deployed with AWS Elastic Beanstalk, employing CI/CD pipeline.
  • WebAppDesktop WebAppMobile

    Link to deployed model: http://sentimenent-analysis-zomato-review.ap-south-1.elasticbeanstalk.com/

    📘 Conclusion

    The following conclusions were drawn from Modelling:

  • Either of the two models, trained using K means algorithm or DBSCAN algorithm, can be chosen for clustering the restaurant dataset based on cuisines, depending on the number of clusters preferred and whether or not outliers be included.
  • The model built using K means algorithm is selected for clustering based on cost and ratings.
  • For sentiment analysis, the model built using random forest algorithm was chosen over others.
  • If model interpretability is more important than accuracy, model built using logistic regression should be chosen. Since the difference between accuracy of these two models is less than 7%, there won't be much difference in the result.
  • 📜 Credits

    Midhun R | Avid Learner | Data Analyst | Data Scientist | Machine Learning Enthusiast

    Contact me for Data Science Project Collaborations

    LinkedIn Badge GitHub Badge Medium Badge Resume Badge

    📚 References