Chapter 8 - Collaborative - Filtering
Chapter 8 - Collaborative - Filtering
Collaborative
Filtering
COMP3278 Introduction to
Database Management Systems
Department of Computer Science, The University of Hong Kong
Slides prepared by - Dr. Chui Chun Kit, for students in COMP3278
For other uses, please email : [email protected]
Real Life Example
If I browse Spider-Man
Blue-ray disk in Amazon…
2
Real Life Example
3
Making Prediction
We are going to
predict Bob’s
rating(s). We call
him the Active user.
Bob 4 ? 5 5
Alice 4 2 1
Peter 3 2 4
Kit 4 4
Jolly 2 1 3 5
Memory-based
Approach
Towards a more intelligent web system
Two questions
1. Measuring Similarities - How to represent the similarity
between users?
Correlation-based similarity
8
Vector-cosine similarity
Bob and Kit
Transformer III Iron Man II
Theta is the angle that represents the similarity of two users u and v.
A larger Θ means that the two users u and v are less similar, vice versa.
11
Vector-cosine similarity
12
Angle sum and difference
Distance formula https://en.wikipedia.org/wiki/Distance
d = sqrt[ (ru,x -rv,x ) 2 + (ru,y -rv,y ) 2 ]
d
1
13
Angle sum and difference
Distance formula https://en.wikipedia.org/wiki/Distance
d = sqrt[ (ru,x -rv,x ) 2 + (ru,y -rv,y ) 2 ]
d
1
= sqrt[ (cos θu - cos θv ) 2 + (sin θu - sin θv) 2 ]
sin θu 1
sin θv
cos? θu cos θv 14
Angle sum and difference
Distance formula https://en.wikipedia.org/wiki/Distance
d = sqrt[ (ru,x -rv,x ) 2 + (ru,y -rv,y ) 2 ]
d
1
= sqrt[ (cos θu - cos θv ) 2 + (sin θu - sin θv) 2 ]
sin θu 2 + cos θu 2 = 1
Pythagorean identity
https://en.wikipedia.org/wiki/List_of_trigonometric_identities
15
Angle sum and difference
Distance formula https://en.wikipedia.org/wiki/Distance
d = sqrt[ (ru,x -rv,x ) 2 + (ru,y -rv,y ) 2 ]
d
1
= sqrt[ (cos θu - cos θv ) 2 + (sin θu - sin θv) 2 ]
17
Vector-cosine similarity
?
|u |is the magnitude of u, i.e., the length of u.
To obtain it, we need to apply the Pythagorean
theorem.
Pythagorean theorem
=
18
Vector-cosine similarity
?
|v |is the magnitude of v, i.e., the length of v.
To obtain it, we need to apply the Pythagorean
theorem.
Pythagorean theorem
=
19
Vector-cosine similarity
Jolly 0 3
Kit 4 5
Ben 2 2.5
(4 × 4 + 5 × 5) / [ sqrt(42+52) × sqrt(42+52) ]
Since similarity between Bob
= ( 16 + 25 ) / [ sqrt(41) × sqrt(41) ]
and Kit calculated in this way
=1
is 1, they are “the same” in
this similarity model.
21
Vector-cosine similarity
Transformer III Iron Man II Similarity similarity
Bob and Kit Bob 4 5 Bob Kit 1
Alice 4 0 Bob Ben 1
Peter 3 2
Rating of Iron Man II
Jolly 0 3
Kit 4 5
Ben 2 2.5
Ben
22
Vector-cosine similarity
Transformer III Iron Man II Similarity similarity
Bob and Kit Bob 4 5 Bob Kit 1
Alice 4 0 Bob Ben 1
Peter 3 2 Jolly Alice 0
Rating of Iron Man II
Jolly 0 3
Jolly Kit 4 5
Ben 2 2.5
Ben
Alice
(0 × 4 + 3 × 0) / [ sqrt(02+32) × sqrt(42+02) ]
=0
Since similarity between Jolly
and Alice calculated in this
way is 0, they are not similar .
23
Example
Transformer III Iron Man II Similarity similarity
Bob and Kit Bob 4 5 Bob Kit 1
Alice 4 0 Bob Ben 1
Peter 3 2 Jolly Alice 0
Rating of Iron Man II
Alice
24
Example
Transformer III Iron Man II Similarity similarity
Bob and Kit Bob 4 5 Bob Kit 1
Alice 4 0 Bob Ben 1
Peter 3 2 Jolly Alice 0
Rating of Iron Man II
27
Correlation-based similarity
Rating of user u on item
y relative to the average
ratings of user u.
No linear correlation
(Like Bob and Alice)
36
Correlation-based similarity
The correlation is actually called the Pearson
coefficient, a well known measure of correlation
between two random variables (u and v).
37
2. Computing prediction
Target: To calculate a prediction for the user a’s
rating on item i (an item which user a has not rated).
Average rating
that user a gave to
other items
Weighted average
of all other users’ ratings on the item i
= + (relative to the corresponding user’s
average rating).
38
2. Computing prediction
Average rating
For other users
rated item i
Weighted
that user a
gave
Average ?
39
2. Computing prediction
Insight: If the weighting with user u is 1
(perfect positive correlation), and if
user u rate the item i as +3 from the his
average. Then we predict user a will
For other users also rate +3 from a’s average.
Average rating rated item i
that user a
gave
Weighting
Relative ratings of each other
(the similarity of that
= +
user on item i user with user a)
Average item i
?
Sum of weightings over all other users who rated on
41
2. Computing prediction
= +
Since the weighting can be negative value (e.g., -1 for
perfect negative correlation), we take the absolute value
when getting the sum of the weight.
43
Example
1. Transformer III 2. Ant-Man 3. Iron Man II 4. Spiderman
1. Bob 4 ? 5 5
2. Alice 4 2 1
3. Peter 3 2 4
4. Kit 4 4
5. Jolly 2 1 3 5
What are the weights between Bob & Alice (w1,2), Bob
& Kit (w1,4), Bob & Jolly (w1,5) respectively?
(Assume that we use Pearson Correlation)
44
w1,2
1. Transformer III 2. Ant-Man 3. Iron Man II 4. Spiderman
1. Bob 4 ? 5 5
2. Alice 4 2 1
3. Peter 3 2 4
4. Kit 4 4
5. Jolly 2 1 3 5
y
Co-rated items : 1. Transformer III and 3. Iron Man II
1. Film 1 – Film 3 –
3. Iron Average
Transform Average Average
Man II (1,3)
er III (1,3) (1,3)
1. Bob 4 5 4.5 -0.5 0.5
2. Alice 4 1 2.5 1.5 -1.5 x
1. Bob 4 ? 5 5
2. Alice 4 2 1
3. Peter 3 2 4
4. Kit 4 4
5. Jolly 2 1 3 5
46
I is the set of co-rated items, for Bob and Jolly, the co-rated items are
The averages
and
are the average score
the users given to
other items.
4
III
Avengers
?
Man II
5
Spiderman
5
2. Alice 4 2 1
3. Peter 3 2 4
4. Kit 4 4
5. Jolly 2 1 3 5
Item1 Item2 Item3 Item4 Item5 Average of 1,2,3,4 Item1 Item2 Item3 Item4 Similarity with Alice
Alice 5 3 4 4 ? 4 +1 -1 0 0 /
User1 3 1 2 3 3 2.25 +0.75 -1.25 -0.25 +0.75 0.85
User2 4 3 4 3 5 3.5 +0.5 -0.5 +0.5 -0.5 0.7
User3 3 3 1 5 4 3 0 0 -2 +2
User4 1 5 5 2 1 3.25 -2.25 +1.75 +1.75 -1.25
Revision
Item1 Item2 Item3 Item4 Item5 Average of 1,2,3,4 Item1 Item2 Item3 Item4 Similarity with Alice
Alice 5 3 4 4 ? 4 +1 -1 0 0 /
User1 3 1 2 3 3 2.25 +0.75 -1.25 -0.25 +0.75 0.85
User2 4 3 4 3 5 3.5 +0.5 -0.5 +0.5 -0.5 0.7
User3 3 3 1 5 4 3 0 0 -2 +2 0
User4 1 5 5 2 1 3.25 -2.25 +1.75 +1.75 -1.25 -0.79
4.165
= 4 +
2.34
= 5.78
51
Item based similarity
Item1 Item2 Item3 Item4 Item5 Alice User1 User2 User3 User4
Alice 5 3 4 4 ? Item1 5 3 4 3 1
User1 3 1 2 3 3 Item2 3 1 3 3 5
User2 4 3 4 3 5 Item3 4 2 4 1 5
User3 3 3 1 5 4 Item4 4 3 3 5 2
User4 1 5 5 2 1 Item5 ? 3 5 4 1
= 4 + 0.59 = 4.59
57
Item-based CF on binary data
We do not always give ratings. When the users
provide only binary data (e.g., the item was
purchased or not/ user like an item or not), how to sim(Item1,item2)
apply collaborative filtering in this case? sim(Item1,item3)
Preprocessing Item1
Item2
Item3
3
1
2 4
5
Item4 5 2
Item5 5
60
Section 2
Model-based
Approach
Motivation
Feature space
Rating of Toy story
Bob
Transformer Toy story
Peter
Bob 4 4
Alice Peter 3 3
Jolly Alice 2 2
Jolly 1 1
Rating of Transformer
Bob likes Transformer and he likes Jolly doesn’t like Transformer and she
Toy story too. doesn’t like Toy story either.
Bob
Peter their “computer animation”
Alice feature. When user rate the two
Jolly movies, they are actually rating on
Rating of Transformer
the “computer animation” feature.
Jolly
Peter greatest variations.
Alice i.e., users’ difference
Bob are captured.
Rating of Transformer
68
A different “angle”
Viewing data from a different “angle” .
Insight: When ratings exhibit greatest variation in an “angle”,
that “angle” should represent an underlying feature.
69
Multiple features
When a user give rating to an item, the rating may
represents his/her preferences on multiple features.
Another “angle”
The line that minimize the sum of
perpendicular to the the shortest distances of the
first angle captures points to the line (best fit line)
the remaining represents one “angle” of viewing
variation of the data. data with greatest variance.
70
Collaborative Filtering (CF)
Through statistical analysis of users’ ratings, we seek
to generate a statistical breakdown of features without
ever having to specify what those features represent.
We would like to generate the features’ weights in items,
and users’ interest in the features.
A standard technique that we can use is called Singular
Value Decomposition (SVD).
Before we delve into the
details of SVD, let’s have
some revision of basic vector
and matrix manipulations
71
Section 2b.
Basics of
vector and matrix
A recap of fundamental mathematics
73
Scalar multiplication
2.5 * v = [ 2.5, 5 ]
Scalar multiplication of a vector
stretches the vector without 2 * v = [ 2, 4 ]
changing its direction.
v = [ 1, 2 ]
74
Dot product
Dot product of two vectors x and y is found by
multiplying each component in x by the component
in y in the same dimension and adding them all
together to yield a scalar value.
75
Dot product
Geometrically, dot product is the A B
product of the length of the two θ
vectors and the cosine of the angle
between them.
A⋅B = |A||B| cos θ
The scalar projection of a vector A in the direction of a
vector B (denote as AB) is given by |A|cosθ (similarly, the
scalar project of a vector B in the direction of A is |B|cos θ ).
A
Two vectors are orthogonal to
each other if their dot product
equals zero.
B
In two dimensional space this is [ 4, -1 ]
equivalent to saying that the vectors
are perpendicular, or that the only angle between them is a
90o angle.
A ∙ B = 1*4 + 4*-1 = 0 OR A ∙ B = |A||B|cos 90o = 0
77
Normal vectors
A normal vector (or unit vector) is a vector of length 1.
Normalization: Any vector with an initial length > 0
can be normalized by dividing each component in it
by the vector’s length.
E.g
and
79
Matrix terminology
Square matrix - A matrix is said to be square if it has
the same number of rows as columns.
A diagonal matrix A is a matrix where all the entries aij
are 0 when i != j.
In other words, the only nonzero values run along the main
dialog from the upper left corner to the lower right corner.
81
Matrix multiplication
The coordinates of AB are determined by taking the
dot product of each row of A and each column in B.
2 1 4 3 2
A B 9 16
1 5 2 -1 4 AB =
0 26
1 2
3 2
ab1,1 2 1 4 . -1
=2*3 + 1*-1 + 4*1 = 9 ab1,2 2 1 4 . 4
=2*2 + 1*4 + 4*2 = 16
1 2
3 2
ab2,1 1 5 2 . -1
=1*3 + 5*-1 + 2*1 = 0 ab2,2 1 5 2 . 4
=1*2 + 5*4 + 2*2 = 26
1 2
1 0
ai1,1 2 4 6 . 0
=2*1+ 4*0 + 6*0 = 2 ai1,2 2 4 6 . 1
=2*0+ 4*1+ 6*0 = 4
0 0
83
1 0 0
Orthogonal matrix A 0 3/5 -4/5
0 4/5 3/5
0
This implies that col 2 of A is a normal
(ATA )2,2 0 3/5 4/5 . 3/5
=0*0+ 3/5*3/5 + -4/5*-4/5 = 1
4/5
vector (because the vector length is 1).
0
This implies that col 3 of A is a normal vector
(ATA )3,3 0 -4/5 3/5 . -4/5
=0*0+ -4/5*-4/5 + 3/5*3/5 = 1
3/5
(because the vector length is 1).
0
0 3/5 4/5 . -4/5
This implies that col 2, 3 of A are
(ATA )2,3 =0*0+ 3/5*-4/5 + 4/5*3/5 = 0
3/5 orthogonal (because their dot product is 0)
84
Section 2c.
Singular value
decomposition
Reference: The Effects of Singular Value Decomposition on Collaborative Filtering by Michael H. Pryor.
Singular value decomposition
The user rating vectors can be Toy story Transformer
Jolly 1 1
represented as an m * n matrix, Alice
Peter
2
3
2
3
A, with m users and n items. Bob 4 4
Rating of Transformer
UT U I
Toy story Transformer
0.183 0.365 0.548 0.730 0.183 -0.969 1 0
-0.969 0.025 0.241 0.049 0.365 0.025 = 0 1 Jolly 1 1
0.548 0.241 Alice 2 2
0.730 0.049 Peter 3 3
Bob 4 4
Property of SVD: UT U = I
Therefore the column vectors of U are normal
vectors and are orthogonal to each other
(orthonormal).
88
Example
A U S VT
Rating of Transformer
VT V I
Toy story Transformer
0.707 -0.707 0.707 0.707 1 0
0.707 0.707 -0.707 0.707 = 0 1 Jolly 1 1
Alice 2 2
Peter 3 3
Bob 4 4
Property of SVD: VT V = I
Therefore the column vectors of V are normal
vectors and are orthogonal to each other
(orthonormal).
89
A statistical breakdown
A U S VT
US VT
US VT
91
A statistical breakdown
A U S VT
Rating of Transformer
1 1 U1,1 S1,1 + U1,2 S2,1 U1,1 S1,2 + U1,2 S2,2 VT1,1 VT1,2
2 2 … …
3 3 = … … VT2,1 VT2,1
4 4 … …
US VT
Note that since S is a diagonal matrix, all Si,j with i ≠ j
are 0. Therefore we can simplify the calculation and
remove all the terms with Si,j with i ≠ j . 92
A statistical breakdown
A U S VT
Rating of Transformer
1 1 U1,1 S1,1 + U1,2 S2,1 U1,1 S1,2 + U1,2 S2,2 VT1,1 VT1,2
2 2 … …
3 3 = … … VT2,1 VT2,1
4 4 … …
A1,1 = U1,1 S1,1VT1,1 + U1,2 S2,2 VT2,1 = 0.183 * 7.746 * 0.707 + -0.969 * 0 * -0.707 = 1
A2,1 = U2,1 S1,1VT1,1 + U2,2 S2,2 VT2,1 = 0.365 * 7.746 * 0.707 + 0.025 * 0 * -0.707 = 2
A statistical breakdown
A U S VT
Rating of Transformer
A1,1 = U1,1 S1,1VT1,1 + U1,2 S2,2 VT2,1 = 0.183 * 7.746 * 0.707 + -0.969 * 0 * -0.707 = 1
94
A statistical breakdown
A U S VT
1 1 0.183 -0.969 7.746 0 0.707 0.707
This summation shows
2 2 0.365 0.025
3 3
= 0 0 -0.707 0.707 that the rating Aij can
0.548 0.241
4 4 0.730 0.049 be constructed as a sum
V
0.707 -0.707 over the features of the
0.707 0.707
product of
- The user i’s interest in
A4,2 = U4,1 S1,1 V2,1 + U4,2 S2,2 V2,2 each feature (U),
- The importance of
= 0.730 * 7.746 * 0.707 + 0.049 * 0 * 0.707
the each feature (S),
≈ 4
… …
- The amount of each
V1,1 V1,2
A4,2 =
…
…
…
… V2,1 V2,2
feature in item j (V).
U4,1 S1,1 + U4,2 S2,1 U4,1 S1,2 + U4,2 S2,2
… …
… …
V1,1 V1,2
= … …
V2,1 V2,2
U4,1 S1,1 U4,2 S2,2
… …
… …
= … … = U4,1 S1,1V2,1 + U4,2 S2,2 V2,2
… U4,1 S1,1VT1,2 + U4,2 S2,2 VT2,2
Feature 1 Feature 2 95
SVD and Collaborative filtering
A U S VT
1 1 0.183 -0.969 7.746 0 0.707 0.707
2 2 0.365 0.025
3 3
= 0 0 -0.707 0.707
0.548 0.241
4 4 0.730 0.049
V
0.707 -0.707
0.707 0.707
Rating of item 2
1 1 0.183 -0.969 7.746 0 0.707 0.707
2 2
= 0.365 0.025 0 0 -0.707 0.707 Jolly
3 3 0.548 0.241
4 4 0.730 0.049 Peter
Alice
Bob
Rating of item 1
A1,1 = U1,1 S1,1VT1,1 + U1,2 S2,2 VT2,1 = 0.183 * 7.746 * 0.707 + -0.969 * 0 * -0.707 = 1
Feature 1 Feature 2 97
Example 2
Rating of item 2
[2,3]
A U S VT
1 1 0.153 0 9.220 0 0.707 0.707
2 2 0.307 0
3 3
= 0 1 -0.707 0.707
0.460 0
4 4 0.614 0
2 3 0.383 0.707 V
3 2 0.383 -0.707
Item 1 0.707 -0.707 Rating of item 1
Item 2 0.707 0.707
Observation:
Both items 1 and 2 have equal
A5,1 = U5,1 S1,1 V1,1+ U5,2 S2,2 V1,2
weight on feature 1 (both are
= 0.383 * 9.220 * 0.707 + 0.707 * 1 * -0.707 0.707).
= 2.4966 - 0.499849 i.e. If user 5 just consider
≈ 2 feature 1, he will rate 2.4966
on item 1 and 2.
A5,2 = U5,1 S1,1 V2,1+ U5,2 S2,2 V2,2
= 0.383 * 9.220 * 0.707 + 0.707 * 1 * 0.707
= 2.4966 + 0.499849
98
≈ 3
Example 2
Rating of item 2
[2,3]
A U S VT
1 1 0.153 0 9.220 0 0.707 0.707
2 2 0.307 0
3 3
= 0 1 -0.707 0.707
0.460 0
4 4 0.614 0
2 3 0.383 0.707 V
3 2 0.383 -0.707
Item 1 0.707 -0.707 Rating of item 1
Item 2 0.707 0.707
Observation:
A5,1 = U5,1 S1,1 V1,1+ U5,2 S2,2 V1,2 Item 1 has negative value on
feature 2.
= 0.383 * 9.220 * 0.707 + 0.707 * 1 * -0.707
Therefore it brings negative
= 2.4966 - 0.499849
effect (-0.4998) to the rating
≈ 2
that user 5 give to item 1.
A5,2 = U5,1 S1,1 V2,1+ U5,2 S2,2 V2,2
= 0.383 * 9.220 * 0.707 + 0.707 * 1 * 0.707
= 2.4966 + 0.499849
99
≈ 3
Section 2d.
Generating
Prediction
Reference: The Effects of Singular Value Decomposition on Collaborative Filtering by Michael H. Pryor.
How to do prediction?
Once the SVD is computed and the U S V matrices
are known, it is possible to predict ratings for items
users have not rated by using the following formula.
V
-0.5551 0.4218 0.6023 -0.3889
-0.5982 -0.4878 0.1835 0.6088
-0.3213 -0.5744 -0.3306 -0.6764
-0.4805 0.5041 -0.7031 0.1437
103
How to do prediction?
A U S VT
5 4 2 6 User 1 -0.6 0.4124 -0.6855 14.489 0 0 0 -0.5551 -0.5982 -0.3213 -0.4805
3 7 5 2
6 4 1 4
= -0.5811 -0.8136 0.01923 0 4.932 0 0 0.4218 -0.4878 -0.5744 0.5041
-0.5498 0.4099 0.7278 0 0 1.655 0 0.6023 0.1835 -0.3306 -0.7031
-0.3889 0.6088 -0.6764 0.1437
Decreasing order
V
Item 1 -0.5551 0.4218 0.6023 -0.3889
-0.5982 -0.4878 0.1835 0.6088
Feature 1 Feature 2 Feature 3 -0.3213 -0.5744 -0.3306 -0.6764
-0.4805 0.5041 -0.7031 0.1437
A1,1 = 5 = U1,1 S1,1 V1,1 + U1,2 S2,2 V1,2 + U1,3 S3,3 V1,3
U4,1 = -0.24867
A4,3 = U4,1S1,1V3,1
With the prediction of U4,1, we = -0.24867 * 14.489 * -0.3213 = 1.576
can predict user 4’s rating on
item 2, item 3 and item 4 (i.e., A4,4 = U4,1S1,1V4,1
A4,2) by predicting his rating on
= -0.24867 * 14.489 * -0.4805 = 1.731
feature 1 only.
106
Consider feature 1 and 2
A U S VT
5 4 2 6 -0.6 0.4124 -0.6855 14.489 0 0 0 -0.5551 -0.5982 -0.3213 -0.4805
3 7 5 2
6 4 1 4
= -0.5811 -0.8136 0.01923 0 4.932 0 0 0.4218 -0.4878 -0.5744 0.5041
-0.5498 0.4099 0.7278 0 0 1.655 0 0.6023 0.1835 -0.3306 -0.7031
-0.3889 0.6088 -0.6764 0.1437
V
Item 1 -0.5551 0.4218 0.6023 -0.3889
Item 2 -0.5982 -0.4878 0.1835 0.6088
Feature 1 Feature 2 -0.3213 -0.5744 -0.3306 -0.6764
-0.4805 0.5041 -0.7031 0.1437
V
-0.5551 0.4218 0.6023 -0.3889
-0.5982 -0.4878 0.1835 0.6088
-0.3213 -0.5744 -0.3306 -0.6764
-0.4805 0.5041 -0.7031 0.1437
2 = U4,1 * -8.0428439 + U4,2 * 2.0803176 …(i)
7 = U4,1 * -8.6673198 + U4,2 * -2.4058296 …(ii) We can
From (ii) U4,1 = (7 + 2.4058296 U4,2 ) / -8.6673198 …(iii) solve (i) and
Substitute (iii) to (i) 2 = ((7 + 2.4058296 U4,2 ) / -8.6673198) * -8.0428439 + U4,2 * 2.0803176
(ii) for U4,1
2 = ((7 + 2.4058296 U4,2 ) 0.927951 + U4,2 * 2.0803176 and U4,2 .
2 = 6.495654 + 2.2325 U4,2 + 2.0803176 U4,2
U = -1.0424 …(iv)
4,2
V
-0.5551 0.4218 0.6023 -0.3889
U4,1 = -0.51829 U4,2 = -1.0424
-0.5982 -0.4878 0.1835 0.6088
Item 3 -0.3213 -0.5744 -0.3306 -0.6764
-0.4805 0.5041 -0.7031 0.1437
109
Prediction with U4,1 and U4,2
A U S VT
5 4 2 6 -0.6 0.4124 -0.6855 14.489 0 0 0 -0.5551 -0.5982 -0.3213 -0.4805
3 7 5 2
6 4 1 4
= -0.5811 -0.8136 0.01923 0 4.932 0 0 0.4218 -0.4878 -0.5744 0.5041
-0.5498 0.4099 0.7278 0 0 1.655 0 0.6023 0.1835 -0.3306 -0.7031
-0.3889 0.6088 -0.6764 0.1437
V
-0.5551 0.4218 0.6023 -0.3889
U4,1 = -0.51829 U4,2 = -1.0424
-0.5982 -0.4878 0.1835 0.6088
-0.3213 -0.5744 -0.3306 -0.6764
Item 4 -0.4805 0.5041 -0.7031 0.1437
110
Section 2e.
New ways to
compare users
Reference: The Effects of Singular Value Decomposition on Collaborative Filtering by Michael H. Pryor.
Compare users by feature
SVD analysis also offers an interesting way to
compare users and find similar users.
A = U S VT 6 4 3 3
Users’ rating on feature (weighted)
obtained by AV or US
A V = U S VT V This matrix is 8.332 3.010 1.553 -0.309
the user’s 8.742 -3.102 0.954 0.053
A V = U S ( VT V ) response 7.794 2.701 -0.808 -0.516
7.368 -2.770 -0.047 0.044
weighted by
AV=USI feature
9.138
10.176
-1.304
0.374
-0.984
0.136
-0.869
0.494
importance.
AV=US 8.166 1.187 -0.836 1.087
113
Compare users by feature
By simply using normal cosine distance metrics on the
users' feature weights instead of the explicit ratings,
we may be able to find a better set of similar users.
A
Step 1. A new user enters the following ratings 5 6 3 3
Extra readings
- A Survey of Collaborative Filtering Techniques (published in Advances in Artificial Intelligence 2009 by
Xiaoyuan, et al.)
- Application of Dimensionality Reduction in Recommender System -- A Case Study (published in
WEBKDD2000 by Badrul M. Sarwar, et al.)
- Collaborative Tag Recommendations (published in Data Analysis, Machine Learning and Applications
2008 by Leandro Balby Marinho, et al.)
117
Chapter 8.
End
COMP3278 Introduction to
Database Management Systems
Department of Computer Science, The University of Hong Kong
Slides prepared by - Dr. Chui Chun Kit, for students in COMP3278
For other uses, please email : [email protected]