13. 13
Matrix Factorization (MF)
R P Q
R = Rating Matrix, m users, n movies;
P = User Matrix, m users, f latent factors/features;
Q = Item Matrix, n movies, f latent factors/features;
Interpretation:
pu indicates how much user likes f latent factors;
qi means how much one item obtains f latent factors;
The dot product indicates how much user likes item;
14. 14
Matrix Factorization (MF)
minq,p S (u,i) e R ( rui - qt
i pu )2 + l (|qi|2 + |pu|2 )
Goal: Try to learn P and Q by minimizing the squared error
goodness of fit regularization
Goodness of fit: to reduce the prediction errors;
Regularization term: to alleviate the overfitting;
18. Non-context vs Context
18
Companion
• Decision Making = Rational + Contextual
• Examples:
Travel destination: in winter vs in summer
Movie watching: with children vs with partner
Restaurant: quick lunch vs business dinner
19. What is Context?
19
• “Context is any information that can be used to characterize
the situation of an entity” by Anind K. Dey, 2001
• Observed Context:
Contexts are those variables which may change when a same
activity is performed again and again.
• Examples:
Watching a movie: time, location, companion, etc
Listening to a music: time, location, emotions, occasions, etc
20. Context-aware RS (CARS)
20
• Traditional RS: Users × Items Ratings
• Contextual RS: Users × Items × Contexts Ratings
Example of Multi-dimensional Context-aware Data set
User Item Rating Time Location Companion
U1 T1 3 Weekend Home Kids
U1 T2 5 Weekday Home Partner
U2 T2 2 Weekend Cinema Partner
U2 T3 3 Weekday Cinema Family
U1 T3 ? Weekend Cinema Kids
21. 21
• There are three ways to build algorithms for CARS
Context-aware RS (CARS)
23. 23
• List of Contextual PreFiltering Algorithms
Reduction-based approach, 2005
Exact and Generalized PreFiltering, 2009
Item Splitting, 2009
User Splitting, 2011
Dimension as Virtual Items, 2011
User-Item Splitting, 2014
Contextual PreFiltering
24. 24
The underlying idea in item splitting is that the nature of an item, from the user's
point of view, may change in different contextual conditions, hence it may be
useful to consider it as two different items. (L. Baltrunas, F. Ricci, RecSys'09) – In
short, contexts are dependent with items.
Contextual PreFiltering (Item Splitting)
At Cinema At Home At Swimming Pool
25. 25
Contextual PreFiltering (Item Splitting)
User Item Location Rating
U1 M1 Pool 5
U2 M1 Pool 5
U3 M1 Pool 5
U1 M1 Home 2
U4 M1 Home 3
U2 M1 Home 2
High Rating
Low Rating
Significant difference?
Let’s split it !!!
M11: being seen at Pool
M12: being seen at Home
M1
Same movie,
different IDs.
26. 26
Contextual PreFiltering (Item Splitting)
User Item Loc Rating
U1 M1 Pool 5
U2 M1 Pool 5
U3 M1 Pool 5
U1 M1 Home 2
U4 M1 Home 3
U2 M1 Cinema 2
User Item Rating
U1 M11 5
U2 M11 5
U3 M11 5
U1 M12 2
U4 M12 3
U2 M12 2
Transformation
If there is qualified split,
one item will be split to
two new ones.
A binary contextual condition for
splitting:
“Pool” vs. “Non-Pool”
After transformation, we obtain a 2D User-Item rating matrix, so that any traditional
recommendation algorithms can be applied to.
27. 27
Contextual PreFiltering (Item Splitting)
User Item Loc Rating
U1 M1 Pool 5
U2 M1 Pool 5
U3 M1 Pool 5
U1 M1 Home 2
U4 M1 Home 3
U2 M1 Cinema 2
User Item Rating
U1 M11 5
U2 M11 5
U3 M11 5
U1 M12 2
U4 M12 3
U2 M12 2
Transformation
Question: How to find such a split? Pool and Non-pool, or Home and Non-home?
We employ a t-test on two pieces of ratings,
the best choice should help obtain the
largest t value and a small p-value (e.g., < 0.05)
29. 29
Example of Splitting Approaches
0.76
0.78
0.8
0.82
0.84
0.86
0.88
0.9
0.92
0.94
0.96
MF ItemSplitting UserSplitting UISplitting
MAE
Restaurant data: 2309 ratings given by 50 users on 40 restaurants in context Time and Location
32. 32
• Deviation-Based Context-aware MF (CAMF)
Contextual Rating Deviation (CRD): how user’s rating is deviated?
CRD(1) = 0.5 Users’ rating in Weekday is generally higher than
users’ rating at Weekend by 0.5
CRD(2) = -0.1 Users’ rating in Cinema is generally lower than
users’ rating at Home by 0.1
Deviation-Based Context-aware MF
Context D1: Time D2: Location
c1 Weekend Home
c2 Weekday Cinema
CRD(i) 0.5 -0.1
33. 33
Deviation-Based Context-aware MF: CAMF_C
Deviation-Based Context-aware MF
BiasedMF in Traditional RS:
CAMF_C Approach:
Global Average Rating User bias Item Bias User-Item interaction
Contextual Rating Deviation
34. 34
Deviation-Based Context-aware MF: CAMF_CU & CAMF_CI
Deviation-Based Context-aware MF
BiasedMF in Traditional RS:
CAMF_C Approach:
Global Average Rating User bias Item Bias User-Item interaction
CAMF_CU Approach:
CAMF_CI Approach:
35. 35
Example: CAMF
Restaurant data: 2309 ratings given by 50 users on 40 restaurants in context Time and Location
0.6
0.65
0.7
0.75
0.8
0.85
0.9
0.95
1
MF ItemSplitting UserSplitting UISplitting CAMF_C CAMF_CI CAMF_CU
MAE
37. 37
CARSKit: A Java-based Open-source
Context-aware Recommendation Library
There are many recommendation library for traditional recommendation.
Users × Items Ratings