NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship πŸ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release πŸŽ‰
Free Lesson
Intro to Data Science New Release πŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See πŸ”₯
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular πŸ”₯ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New πŸŽ‰ Generative AI for Finance New πŸŽ‰ Generative AI for Marketing New πŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular πŸ”₯ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular πŸ”₯ Data Science R: Machine Learning Designing and Implementing Production MLOps New πŸŽ‰ Natural Language Processing for Production (NLP) New πŸŽ‰
Find Inspiration
Get Course Recommendation Must Try πŸ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release πŸŽ‰
Free Lessons
Intro to Data Science New Release πŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See πŸ”₯
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Capstone > Recommender Systems' Data Impacting People Behaviors

Recommender Systems' Data Impacting People Behaviors

Wonchan Kim, hyelee lee and KISOO CHO
Posted on Sep 24, 2019
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Introduction

There are many ways recommender systems impact the way people behave. For companies, they improve retention for users, increase sales of product, provide insight into future trends, and accelerate processes by efficient filtering. For Netflix, there are data sources that say 75% of what their customers stream comes from their recommendation system (McKinsey).

The general idea of recommender systems is that they provide a comprehensive list of products that have received good overall reviews or are highly favored by similar users based on user data.

Recommender Systems' Data Impacting People Behaviors
Figure 1. Trends in Recommender Systems

As seen in Figure 1, the trend of recommender algorithms has continued to change.

The matrix factorization model makes a user and item matrix and recommends through content-based or collaborative filtering to create a relationship that was not previously present in the data. This model was brought about and popularized by the 2006 Netflix challenge and remains fundamental to recommender systems today.

A wide and deep model utilizes a wide model for recommending the range of goods and a deep model for recommending detailed items of goods. This type of recommender was brought about in 2016 by Google.

A factorization machine is similar to matrix factorization but can encompass more features, thereby enabling the recommender system to give tailored output based off of other miscellaneous features. This method was invented in 2010 by a Google research scientist.

Recently, RNNs or reinforcement learning methods have been developing for use in personalized recommendations since 2016.

All of these various methods aim to reduce problems that recommender systems can often face. These shortcomings include popularity bias, the cold start problem, and scalability.

Objective

Yelp is a company that was founded in 2004 by two members of the "PayPal Mafia", Russel Simmons and Jeremy Stoppelman. It is a business directory forum that crowd-sources its information.

For Yelp, it indubitably makes sense that their platform is greatly dependent upon a recommender system to drive traffic along their website and generate value for businesses listed on their site. Better targeted users for businesses mean better reviews which ultimately lead to better business value. A Harvard Business School study published in 2011 found that each "star" in a Yelp rating affected the business owner's sales by 5–9 percent (Harvard).

With all of this in mind, we used a dataset that was sourced from Yelp's Open Dataset. This is a dataset that contained nearly 7 million reviews, almost 2 hundred thousand businesses, and much more.

With this project, our objective was specifically to provide restaurant recommendations to users with 10 or more reviews.

We did not want to focus on users with not enough data because it would more or less defeat the purpose of a recommender system if we could just generate businesses with the most reviews or highest ratings. However, we did encompass a base model to also recommend restaurants to users with less than 10 reviews so that any test user passed through could guarantee a list of restaurants to choose from.

Exploratory Data Analysis

Because of the size of this dataset, we took a deeper dive into each aspect of the data. For this project, we only utilized the review.json, user.json, and business.json files in order to build the recommender system.

Recommender Systems' Data Impacting People BehaviorsFigure 2. Data analysis on reviews

These graphs display some basic information for reviews of the dataset. The number of cool, funny, and useful votes that reviews ended up getting came out to be very similar. However, when looking at the distribution of stars, we see that the number of 5 stars was the most prevalent followed by 4 stars then 3. This is important because if one thinks about reviews in general, they’re subjective and goes into psychology that we could further leverage in future analyses.

Recommender Systems' Data Impacting People BehaviorsFigure 3. Data analysis on restaurants

In the data for restaurants, we saw that the majority of restaurants had review counts less than 30 with a max review count of 8570, thus presented a very right skewed distribution. This is an important because the impact of a few low ratings for restaurants that aren’t as popular are huge compared to restaurants that have a lot of reviews. This discovery is meaningful when coming up with a list of recommendations for users.

Also, the distribution of the star ratings for all of the restaurants are skewed left. This is interesting because it makes you consider the restaurant’s attributes, such as size, social media presence and more.

Recommender Systems' Data Impacting People BehaviorsFigure 4. Data analysis on users

These graphs show the information on users in the dataset. The average star rating distribution by user is very similar to the previously seen distribution of stars for all reviews. Other features also display a very right-skewed distribution. 

In addition, the user-specific review count shows a huge right skew, even more than the distribution for review counts for each restaurant, and it was because most users wrote less than 5 reviews.

Recommender Systems' Data Impacting People BehaviorsFigure 5. Review count distribution per category

As seen in Figure 5 displaying the categories present in the dataset, there were so many options that a restaurant could have as a feature. They were not labeled according to more specific encompassing groups such as β€œcuisine”. Because of this diversity, there were no clear separating groups and there was sparsity once we flattened out these categories as each individual feature.

Taking a look at the matrix overall, we calculated the ratio of filled reviews (1,386,124) to the combination of user and restaurant (4,115,847,712). We found the result to be a very sparse matrix (only 0.03% filled!!), thereby making it much harder to account for personalization.

Recommender Systems' Data Impacting People BehaviorsFigure 6. Filtering process of dataset

Because the Yelp dataset contained all types of businesses, we extracted all of the restaurants by looking at value counts of categories and intuition in regards to the categories within the step of EDA.

Also, by trying to segment the data further by cities, states, etc., we realized that although this dataset was indeed very big, it did not nearly give a big enough picture for the trends that could come up in different parts of the world. This was because there were a lot of missing states and cities. For example, there were no Los Angeles entries and there were only 13 New York entries.

Taking this into consideration, we had to decide how to focus this project and thus filtered our data to include the entries in the city of Las Vegas only, considering that it was the number two city in regards to the number of reviews and a US city (as opposed to a Canadian city).

Out of the total 600 categories, the number of categories related to restaurants was 177 but we condensed these further into 88 categories for our model.

Some of the restaurant's attributes, such as romantic ambience, would have been useful for learning, but we decided that it was more appropriate to filter according to the user's preferences to certain attributes after the model had ranked the restaurants because the data matrix was already too sparse. Because of a lack of time, this filtering via attributes was not implemented in this project.

Recommender System

Factorization Machine

The first model we applied was a Factorization Machine using the xlearn package. If the model learned through the use of the full dataset, the ability to learn would have been too difficult because of disparities in review counts. Therefore, we filtered for users who had written at least 10 reviews and combined the user, review, and restaurant information to pass into the model.

The field-aware FM model adds another dimension to the latent vector, which allows the model to provide more accurate results. It was used to learn categories in an additional dimension.

Deep Factorization Machine
Recommender Systems' Data Impacting People Behaviors
Figure 7. Deep FM

The second model we used was a Deep Factorization Machine (Figure 7). It is a model where input data is divided into an FM layer and a deep layer and the FM is applied to a wide and deep model.

If the same inputs are duplicated into different types of factorization machine models and deep neural network models, FMs can model the interaction of low order features and the DNN can model the interaction of high order features.

Matrix Factorization
Figure 8. User-item matrix for Matrix Factorization

The third model utilized was matrix factorization using singular value decomposition or SVD as seen in Figure 8. This model presents user-restaurant relationships as a matrix and mathematically disassembles the matrix to predict the empty customer's stars. This is implemented using an easy-to-use package called surprise.

Surprise is a Python scikit for recommender systems. It provides various ready-to-use prediction algorithms such as baseline algorithms, neighborhood methods, matrix factorization-based models, and many others. 

We used different methods of MF to train the model and measured the RMSE values. Performance was compared between SVD, baseline only, and SVDPP. From these, the SVD algorithm was finally selected to predict the user's restaurant-specific rating.

Data Results

Figure 9. Results of the models

The learning outcomes for all three models were similar. The MF model with Surprise scored slightly higher, but overall the figure was similar. By looking at Figure 9, we see the higher the stars in the restaurant, the higher the predicted scores.

We used the same dataset for all three models, but we applied a 10 or more review count filter to the DeepFM and factorization machine models. In contrast, we supplied the entire dataset to the matrix factorization model. Each score was normalized, then ensembled with each weight to make a final ranking. Data excluded from the DeepFM and factorization machine were taken into consideration by weighting the results of matrix factorization.

Flask App

Figure 10. Flask web application structure

We built and deployed a Flask web application for our demo of this recommender system. Because of a lack of time, we couldn’t upload our data into a database and use Flask SQLAlchemy to send queries in order to output resulting recommendations.

Instead, we first saved our trained model then used it within our app.py file in order to pass in test cases with users already in the dataset. For the front end, we used CSS stylesheets and HTML templates for each of the pages in our app.

The figures shown below are screenshots of our Flask app. For our demo, because of a lack of interpretability when analyzing results of the initial ensembled model we had made, we had to make a new model with all of the weight only applied to categories of restaurants. Through this, there was a small addition of interpretability when explaining how the recommender system outputted its results.

  • Recommender Systems' Data Impacting People Behaviors
  • Recommender Systems' Data Impacting People Behaviors
  • Recommender Systems' Data Impacting People Behaviors
  • Recommender Systems' Data Impacting People Behaviors

Once again, due to a lack of time, we were not able to deploy our app using services like Google Cloud or Heroku but instead had to settle for our app being deployed on a local server. Because we were fetching results with input data using our local file system, the program took around 6 seconds to output a list of recommendations for a test user.

Conclusion

Recommender systems are so hard to test. Typically, to test in daily operations, companies cannot ask users how the recommendations are perceived so they look through the clickthrough rate of each recommendation. We could only look at the numbers of our results but not much more.

There’s a clear concern about data leakage because the test users in our model are users who were present when training the models initially. However, in regards to this, we wanted to build a comprehensive model that took into account many factors holistically rather than merely filtering and spitting out best rated or most popular restaurants. In this project, we targeted specifically recommending restaurants for users that had data already. 

Rather than manipulating the data in our local environment, we realized that it would have been more conducive to utilize the cloud or a distributed environment. Doing this would have prevented delays in the processing or storing of our data using our local system, increasing efficiency greatly. Therefore, we realized how important it is to consider the environment in which we work.

Our demo's output of results was not interpretable using our ensembled model. Therefore, just as other companies such as Netflix does, we should train separate models depending on each feature such as categories, reviews, etc. Otherwise, no matter how good the results may be, it is not explainable in any way. Although this doesn’t matter as long as the recommendations drive business value, we realized that this is very important to consider from a data scientist’s perspective, especially in a setting where there is no easy way to test our results.

Sources

  • McKinsey
  • Harvard

About Authors

Wonchan Kim

Wonchan graduated from the University of California, Los Angeles with a B.S. degree in Materials Engineering and a minor in Statistics in 2019. Wonchan has proven acumen in business applications and experience tailoring data analysis and machine learning...
View all posts by Wonchan Kim >

hyelee lee

View all posts by hyelee lee >

KISOO CHO

View all posts by KISOO CHO >

Related Articles

Capstone
Catching Fraud in the Healthcare System
Capstone
The Convenience Factor: How Grocery Stores Impact Property Values
Capstone
Acquisition Due Dilligence Automation for Smaller Firms
Machine Learning
Pandemic Effects on the Ames Housing Market and Lifestyle
Machine Learning
The Ames Data Set: Sales Price Tackled With Diverse Models

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    Β© 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application