Recommender Systems-Chapter 2
Recommender Systems-Chapter 2
Chapter 2
Sara Qassimi
[email protected]
1
Non-personalized recommender systems
Page Rank
● Used for search results
6
The probability of staying in state A (P(1,1)) is 0.3 or 30%.
The probability of transitioning from state A to state B (P(1,2)) is 0.4 or 40%.
The probability of transitioning from state A to state C (P(1,3)) is 0.3 or 30%.
For example, if we look at the first row, which corresponds to starting in state A(1):
P(1,1) + P(1,2) + P(1,3) = 0.3 + 0.4 + 0.3 = 1.
This shows that if we are in state A (1), the matrix correctly represents that we will
either stay in A, move to B, or move to C, with probabilities that add up to 1.
Which is the total probability that something will happen, ensuring that the system
will definitely make a transition in the next step.
7
Markov Chains
Explained Visually
Markov Models : Exemple
● State 1 = Sunny
● State 2 = Rainy
● Let’s suppose:
if today is sunny, then the chance that tomorrow will be sunny is high
The chance that the state goes from sunny to rainy is very small
○ p(sunny | sunny)= 0.9
○ p(sunny | rainy)= 0.1
○ p(rainy | sunny)= 0.1
○ p(rainy | rainy)= 0.9
count up the total number of days it was sunny and count up
the total number of days It became rainy after it was sunny.
Then divide those two numbers to get the probability.
Given a matrix A, find a vector and a scalar s.t. Multiplying the vector by A is
equivalent to stretching it by the scalar
This is exactly the kind of model you can build if you want to predict the future
If you can model some process as a Markov model and you can measure your state distribution, then
predicting your state distribution at some point in the future is just a matter of multiplying by A
Pr. Sara Qassimi 14
FST- UCA
PageRank
programmer
● Lot of data about user and his preferences needs to be collected to get the best
recommendation
● Sparsity: Insufficient required data to extract descriptive metadata and ratings about items.
● In practice there are 20% of items that attract the attention of 70-80% of users and 70-80% of
items that attract the attention of 20% of users.
● Recommender’s goal is to introduce other products that are not available to users at first
glance. In a content based approach this goal is not achieved as well as in collaborative
filtering.
TF-IDF and Cosine Similarity: Implement a content-based recommender system using TF-IDF (Term
Frequency-Inverse Document Frequency) for text features such as product titles and descriptions. Use
cosine similarity to measure similarity between products.
Exercice 2:
Word Embeddings: Instead of TF-IDF, use word embeddings like Word2Vec or GloVe to represent text
features. Compare the results with TF-IDF.
Exercice 3:
Image Classification Model: Build an image classification model (e.g., a convolutional neural network)
to classify products into categories (e.g., men, women, boys, girls). Then, recommend products from
the same category based on image classification.
Exercice 4:
Hybrid Recommender System: Combine both text-based and image-based recommendations. You can
use an ensemble approach or a weighted average of the two recommendation scores.
Exercice 6:
Deep Learning Model: Build a deep learning model (e.g., a neural collaborative filtering
model) for content-based recommendations. Use embeddings for both user and product
features and incorporate image and text information.
Exercice 7: