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 > Data Visualization > Data Analysis Behind Recommendation System: Great Book Reads

Data Analysis Behind Recommendation System: Great Book Reads

SWETA PRABHA
Posted on Nov 7, 2021

The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Github | Linkedin

Data Science Introduction

Recommendation systems have gained huge popularity among eCommerce and online media in the last few years to increase user interaction. Many of our day-to-day choices are driven by personalized recommender systems that are made possible using common data and machine learning algorithms. Some common recommender systems are Netflix suggestions for movies, music on Spotify, Google Ads, and product recommendations on Amazon.

There are two major types of recommendation systems used by most businesses. CONTENT-BASED and COLLABORATIVE. Content-based recommender systems use item features to recommend similar products. For example, if I am a fan of Agatha Christie, the system will recommend me other books from the same author or cozy mysteries from other authors. Collaborative recommender system clusters similar types of users to recommend the item that one user from the cluster has recommended to the other users who did not try the item.

In this article, I have explored the basic concepts behind collaborative recommendation systems using the book feature dataset from Goodreads. As with any other machine learning project, I started with Exploratory Data Analysis and wrapped it up with codes for a basic user-based recommendation system.

Exploratory Data Analysis

Dataset

The data was collected from UCSD Book Graph. I used the complete book graph from the metadata of books and Book Reviews for this project. A subset of 150k books was used from the book graph dataset containing 27 features including Title, publishers, ratings, image_url, language, etc. The review dataset contained 10k rows of user-id, book id, and user rating which was sorted for books published between 2000-2017 from the book graph dataset. I have used RStudio for this project.

EDA

For exploratory data analysis, the following questions were investigated,

  • Number of books published each year
  • How does a number of pages affect popularity?
  • Which books have the maximum versions?
  • What are the most popular languages?
  • How did the popularity of eBooks change in the last decade?
  • Which format is most popular?
  • How are average rating and popularity related?
  • What ratings are more likely?
  • Top 10 publishers and their popularity?

Data on Books Published Each Year

Fig 1 and Fig 2 give the number of publications between 1900-2017 from my dataset. It was seen most books in the dataset were between 2000 and 2017 and rows containing books from these years were filtered out. It was also observed that the number of publications increased after 2007. This is when kindle was launched and ebooks started gaining popularity.

 

Data Analysis Behind Recommendation System: Great Book Reads
Fig 1: Books Published between 1900-2017
Fig 2: Books published between 2000-2017


Number of Pages

The number of ratings is considered an estimation of how many people read the book or the popularity. As seen from the scatterplots of the number of pages vs average rating (Fig 4) and the number of pages vs the number of ratings (Fig 5), thick books are less popular but mostly high rated with very few outliers. Most popular books are between 200-400 pages long.

Data Analysis Behind Recommendation System: Great Book Reads
Fig 3: No. of pages vs avg rating
Data Analysis Behind Recommendation System: Great Book Reads
Fig 4: No. of Pages vs No. of ratings


Data on Number of Authors and Different Versions

My dataset has books up to 51 authors. It is seen that books with more than 10 authors are highly rated although the relation is not linear since there were many highly rated single-author books but very few books with more than 10- authors are rated below 3 (Fig 5).

There are few books with many versions including languages, formats, and editions. The most number of versions from my dataset is Stolz und Vorurteil (Fig 6), which is german for Pride and Prejudice. There are 3000 versions of this Jane Austen 1813 novel published in different languages.

Data Analysis Behind Recommendation System: Great Book Reads
Fig 5: Average rating of different number of authors
Data Analysis Behind Recommendation System: Great Book Reads
Fig 6: Top 10 books with maximum versions


Language & format

Analyzing from the bar chart in Fig 8, English is the most popular language followed by Spanish, Arabic, and French. Also, the kindle has a great impact on people's reading behavior. kindle is more popular than all other forms of ebooks.

Fig 7: Most popular formats
Fig 8: Popular Languages


Data on Average Rating & Popularity

As the number of readers increases, the average rating starts dropping. Reviewing Fig 9, no books with average rating 5 has more than 500 reviews. In the case of books, an average rating of 3.5 or above can be considered safe as long as popularity is concerned. There are critics even for the best works. IT IS DIFFICULT TO KEEP EVERYONE HAPPY!

Fig 9: Average Rating and Popularity

Publishers

CreateSpace, a self-publishing platform owned by amazon has published the maximum number of books(Fig 10) from the dataset. The books published by CreateSpace are rated high (Fig 11) and are quite popular to acquire the top 10 most number of ratings from my dataset. This is another example of more and more people adapting kindle. Vintage, the New York-based publishing house is the most popular publisher with many highly-rated books.

Fig 10: Top 10 publishers with highest no. of books
Fig 11:Average Ratings of top 10 publishers


Fig 12: Top 10 most popular publishers

Popularity of eBooks Data

After Kindle's release in 2007, the popularity of ebooks has grown tremendously. As seen from Fig 13, the number of ebooks sored after 2011. This is when kindle provided its self-publishing platform for freelance and independent writers. In 2011, kindle helped amazon reach $10 Billion in revenue.

Data Analysis Behind Recommendation System: Great Book Reads

Fig 13: Number of ebooks published between 2000 and 2017

Recommendation System

For this project, I have investigated collaborative recommender systems. There are two types of collaborative recommendation systems. Item-Based and User-Based.

Item Based Collaborative Recommender System

The item-based recommender system model was proposed by amazon in 1998. It takes into account the similarity between items and the frequency of users buying the items together. For example, if a user is viewing Agatha Christie's 'the murder of roger Ackroyd, the model will look for users who have already recommended the book before, and then check for books recommended/bought by those users. In the picture (Fig 14), this is done by matching ratings of the books purchased with the current book.

Data Analysis Behind Recommendation System: Great Book Reads

Fig 14: Item-based collaborative Recommender System

 

User-Based Collaborative Recommender System

In a user-based recommender system, the similarity between users is checked.

As shown in Fig 15, both user1 and user2 are Agatha christie fans and have recommended 3 of her books (who doesn't love her mysteries!!!). Now,user2 recommended Sherlock Holmes, which is a similar genre too. Based on this behavior the model will recommend user1 Sherlock Holmes too. This is a user-based recommender model.

 

Fig 15: User-based collaborative recommender System

The Basic Maths Behind Gathered Data

To visualize a collaborative recommender system model, we have to first understand the user-item matrix and similarity function. A user-item matrix generated from the book review dataset is shown in Fig 16. Each row represents a user and each column represents a book. The entries are the ratings given by each user to the books they have read. There are a lot of NAs within the matrix since every user hasn't read every book. Due to the ease of computation, a similarity function is introduced.

There are many types of similarity functions, like cosine similarity, Pearsonโ€™s correlation coefficient, Euclidean distance, etc. For this project, the cosine similarity function is used (Fig 17). As shown in the matrix (Fig 18), the cosine similarity function can be implemented row-wise (user-based) or column-wise (item-based). The cosine similarity between U1 and U5 is maximum and so the book that U5 has read and U1 has not read will be recommended to U1. For the item-based approach, the cosine similarity between B1 and B5 is maximum, so the user who reads B1 will be recommended B5 if they have not already read B5.

Fig 16: User-Item Matrix

 

Cosine Similarity Formula (wikipedia)
Fig 17: Cosine Similarity Calculation


 

Data Analysis

Top Recommended Books for User 2955

Using the model the following books were recommended to User 2955. The ones with image URLs retrieved the images. Meanwhile, the count column represents the number of similar users and the rating column returned the rating given by those users to the given book.

Top 5 books recommended to user 2955

Output:

Future Works

For future work, I am planning to build a hybrid content-based & collaborative recommender system and implement some findings from EDA for filtering (for example, thick books are less popular). A scalable dashboard with the codes at the back end can be generated which could be used by book eCommerce platforms. To test the final model, A/B testing is an essential component as there is no way of telling the effectiveness of a recommendation system model without being implemented for real users.

References

Mengting Wan, Julian McAuley, "Item Recommendation on Monotonic Behavior Chains", in RecSys'18.

Mengting Wan, Rishabh Misra, Ndapa Nakashole, Julian McAuley, "Fine-Grained Spoiler Detection from Large-Scale Review Corpora", in ACL'19.

About Author

SWETA PRABHA

Data Scientist with 5 years experience in Academic Research and supply chain Industry. Expertise in Problem Solving, statistical analysis and machine learning models.
View all posts by SWETA PRABHA >

Related Articles

Capstone
Catching Fraud in the Healthcare System
Data Analysis
Car Sales Report R Shiny App
Data Analysis
Injury Analysis of Soccer Players with Python
Capstone
Acquisition Due Dilligence Automation for Smaller Firms
R Shiny
Forecasting NY State Tax Credits: R Shiny App for Businesses

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