0% found this document useful (0 votes)
37 views37 pages

Machine - Learning (Recommendation System)

The document discusses recommendation systems. It defines recommendation systems as tools that suggest products, services, and content to users based on their preferences. It outlines several types of recommendation systems, including content-based, collaborative filtering, hybrid, and discusses algorithms commonly used like user-based collaborative filtering. Finally, it provides an overview of how to build a recommendation system, from data preprocessing to evaluation.

Uploaded by

xavieranosike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views37 pages

Machine - Learning (Recommendation System)

The document discusses recommendation systems. It defines recommendation systems as tools that suggest products, services, and content to users based on their preferences. It outlines several types of recommendation systems, including content-based, collaborative filtering, hybrid, and discusses algorithms commonly used like user-based collaborative filtering. Finally, it provides an overview of how to build a recommendation system, from data preprocessing to evaluation.

Uploaded by

xavieranosike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

RECOMMENDATION SYSTEM

Ishaya, Jeremiah Ayock


Lecture 10 Week 11

May 1, 2023
Academic City University College, Agbogba Haatso, Ghana.
Recommendation System
INTRODUCTION

Recommendation systems are an integral part of our daily


lives. Almost every website we visit, every app we use, and
every service we subscribe to make use of recommendation
systems to suggest products, services, and content to us.
Whether it is personalized music playlists on Spotify, product
recommendations on Amazon, or movie suggestions on
Netflix.

1
These systems have the ability to predict user preferences
and provide tailored recommendations, improving user
experience and increasing engagement.
We will learn about the various types of recommendation
systems, how they work, applications, and the algorithms used
to build them.

2
TYPES OF RECOMMENDATION SYSTEMS

Content-based Recommendation Systems:


These recommendation systems recommend items to users
based on their preferences and previous choices. They
recommend items that are similar to the ones the user has
liked in the past.
The system analyses the features of the items the user has
liked and recommends items with similar features.

3
ADVANTAGES

• Easy to implement and does not require any user data.


• Can recommend new items that the user has not
interacted with previously.

4
DISADVANTAGES

• Limited to recommending items with similar attributes to


the user’s past preferences.
• Can lead to overfitting if the system is not updated
frequently.

5
TYPES OF RECOMMENDATION SYSTEMS

Collaborative Filtering Recommendation Systems:


These recommendation systems recommend items to users
based on the preferences of other similar users. They use
the user-item interaction data to build a model that can
predict the ratings or preferences of a user for an item.
The system then recommends items with the highest
predicted ratings.

6
USER-BASED COLLABORATIVE FILTERING

User-based collaborative filtering identifies users who


have similar preferences to the target user and recommends
items that those users have liked.
The system first identifies the most similar users to the target
user based on their past behaviour, then recommends items
that those users have liked.

7
ADVANTAGES

• Can recommend items that the target user has not


interacted with previously.
• Can handle new items with no user interactions.

8
DISADVANTAGES

• Can lead to the cold start problem, where new users have
no interaction history, and the system cannot recommend
anything.
• The system relies on user data, which can be biased or
incomplete.

9
ITEM-BASED COLLABORATIVE FILTERING:

Item-based collaborative filtering identifies items that are


similar to the ones that the target user has liked and
recommends those items.
The system first identifies the most similar items to the target
item based on user behaviour, and then recommends those
items.

10
ADVANTAGES

• Can handle new users with limited interaction history.


• Can recommend items that the target user has not
interacted with previously.

11
DISADVANTAGES

• The system relies on user data, which can be biased or


incomplete.
• Can lead to the sparsity problem, where the user-item
interaction matrix is very sparse.

12
TYPES OF RECOMMENDATION SYSTEMS

Hybrid Recommendation Systems:


These recommendation systems combine both content-based
and collaborative filtering approaches to recommend items to
users.
They use the strengths of both approaches to provide more
accurate recommendations to users.

13
ADVANTAGES

• Can provide more accurate and diverse recommendations.


• Can overcome the limitations of individual
recommendation algorithms.

14
DISADVANTAGES

• More complex to implement and maintain.


• Requires more data and computational resources.

15
ALGORITHMS USED IN RECOMMENDATION SYSTEMS

User-based Collaborative Filtering:


This algorithm recommends items to a user based on the
preferences of similar users.
It first identifies users who have similar preferences and then
recommends items that similar users have liked or rated highly.

16
ALGORITHMS USED IN RECOMMENDATION SYSTEMS CON’T

Item-based Collaborative Filtering:


This algorithm recommends items to a user based on the
preferences of similar items.
It first identifies items that are similar to the ones the user has
liked and then recommends those similar items.

17
ALGORITHMS USED IN RECOMMENDATION SYSTEMS

Matrix Factorization:
This algorithm uses a matrix factorization technique to
predict the preferences of a user for an item. It decomposes
the user-item interaction matrix into two matrices: a user
matrix and an item matrix.
These matrices represent the users and items in a lower
dimensional space, where the dimensions represent the latent
features that are not directly observable.
The algorithm then uses these matrices to predict the
preferences of a user for an item.

18
ALGORITHMS USED IN RECOMMENDATION SYSTEMS

Deep Learning: Deep learning techniques such as neural


networks can be used to build recommendation systems.
These techniques can learn complex representations of users
and items and can make accurate recommendations based on
those representations.

19
ALGORITHMS USED IN RECOMMENDATION
SYSTEMS CON’T

Cosine Similarity:
This algorithm measures the similarity between two items by
calculating the cosine of the angle between their feature
vectors.
The feature vectors represent the attributes of the items, and
the cosine similarity measures the overlap between the
attributes.

20
ALGORITHMS USED IN RECOMMENDATION SYSTEMS CON’T

TF-IDF: TF-IDF stands for Term Frequency-Inverse


Document Frequency It is a method used to measure the
importance of a term in a document.
In a recommendation system, it is used to measure the
importance of an attribute in an item. Items with similar
attributes are recommended to the user.

21
EVALUATION OF RECOMMENDATION SYSTEMS

The effectiveness of a recommendation system can be


evaluated using the following metrics:
• Precision:
Precision measures the accuracy of the system in
recommending relevant items to the user.
• Recall:
Recall measures the ability of the system to recommend
all relevant items to the user.
• F1-Score:
F1-score is the harmonic mean of precision and recall. It
provides a balanced measure of the system’s accuracy in
recommending relevant items to the user.
22
STEP-BY-STEP IMPLEMENTATION OF A RECOMMENDATION
SYSTEM

Data Preprocessing
The first step in building a recommendation system is to
preprocess the data.
This involves cleaning the data, removing any duplicates or
missing values, and transforming the data into a suitable
format for the recommendation algorithm.

23
Data Exploration The next step is to explore the data to
gain insights into user preferences and item attributes.
This involves calculating summary statistics, visualizing the
data, and identifying any trends or patterns in the data.

24
Splitting Data The data is then split into training and
testing sets. The training set is used to build the
recommendation system, while the testing set is used to
evaluate the performance of the recommendation system.

25
Building the Recommendation System: The next step is
to build the recommendation system. This involves selecting
an appropriate recommendation algorithm, such as
collaborative filtering or content-based filtering, and applying
it to the training data. The resulting model is used to make
recommendations for the test data.

26
Evaluating the Recommendation System:
The final step is to evaluate the performance of the
recommendation system using evaluation metrics such as
precision, recall, and F1-score.
The recommendation system can be refined and optimized
based on the evaluation results.

27
Deploying the Recommendation System: Once the
recommendation system is built and evaluated, it needs to be
deployed in the production environment.
This involves integrating the recommendation system with the
existing infrastructure and ensuring that it is scalable and
efficient.

28
Continuous Monitoring and Improvement:
The final step is to continuously monitor and improve the
recommendation system based on user feedback and changing
business requirements.
This involves collecting feedback from users, analyzing
performance metrics, and updating the recommendation
algorithm as needed.

29
MATHEMATICS INVOLVED IN RECOMMENDATION SYSTEMS

Collaborative filtering algorithms involve calculating


similarity measures between users or items.
One commonly used similarity measure is cosine similarity,
which measures the cosine of the angle between two vectors.
The cosine similarity between two vectors, x and y , is given by:
Pn
i=1 xi yi
cos(θ) = pPn 2
pPn
2
i=1 xi i=1 yi

where n is the number of dimensions in the vectors.

30
MATHEMATICS INVOLVED IN RECOMMENDATION SYSTEMS

Content-based filtering algorithms involve calculating the


similarity between items based on their attributes.
One commonly used method for measuring the importance of
an attribute is the term frequency-inverse document frequency
(TF-IDF). The TF-IDF score for a term t in document d is
given by:

31
TF-IDF(t, d) = TF(t, d) × IDF(t)

where TF(t, d) is the term frequency of term t in document d,


and IDF(t) is the inverse document frequency of term t. The
IDF of a term t is given by:

N
IDF(t) = log
nt
where N is the total number of documents and nt is the
number of documents that contain the term t.

32
EXAMPLES OF DAY-TO-DAY ACTIVITIES WHERE RECOMMEN-
DATION SYSTEMS ARE USED:

• Movie and TV show recommendations on streaming


platforms like Netflix and Amazon Prime Video.
• Product recommendations on e-commerce websites like
Amazon and eBay.
• Song recommendations on music streaming services like
Spotify and Apple Music.
• Book recommendations on websites like Goodreads and
Amazon.
• News article recommendations on websites like Google
News and Yahoo News.
33
CONCLUSION

Recommendation systems are an essential tool for many


businesses and services. They help in improving user
engagement, increasing sales, and providing better customer
experiences.
In this lecture, we learned about the different types of
recommendation systems, the algorithms used to build them,
and the evaluation metrics used to measure their performance.

34
END OF PRESENTATION

THANK YOU

You might also like