8. CrossValidation
Movies Similarity Matrix
Ratings
Table
Movies->
Users->
Training
Set
Test
Set Features
Ground Truth
C
K
J
B
lue
ids aws abe
1
Consider two users in test set
Features
Test Set
Ground
Truth
4
5
2
2
Ground
Truth
3
4
5
1
5
My Recommendations
2
C
K
J
B
lue
ids aws abe
B
Y
Y
User 1
User 2
Use algorithm and similarity matrix on
to predict
then compare predictions and truth
1
ig
B
ig
Y
P
N
T
Cl
ue
g
Bi
F
Ja
ws
Ba
be
9. Algorithm
Ratings
Table
Movies Similarity Matrix
C
K
J
B
lue
ids aws abe
Movies->
Users->
C
K
J
B
lue
ids aws abe
1
2
3
4
5
f(
5
3
N
one
4
N
3
one
C
B
1
5
lue
abe
21
4 0
.4
0
5
1
4
3
1
4
0
.6 4
3
1
)=
0
.3
0
0
.2
1
.4
ids
.5
For multiple input movies,
.5
.2
.3
1
.2
0
0
0
.4
0
.3
0
.5
0
.2
0
0
.3
0
Say.3
User 1 1 .2 Clue
likes
.3
.3
User 2 likes Babe
0
K
J
aws
0
1
.2
0
.3
0
.3
0
.2
1
.3
0
0
.3
0
.2
0
.3
number is for the movie Big. Users should watch it!
f(s10 2)=mean(s10 2)-α*diff(s1,s2)
,s
,s
0
.5
0
0
0
0
0
1
B .5 B
.4 C .2 K .2 J
B lue 0 ids 0 aws0 abe0 ig
1
0
ig C .5
.3 0 .3 0 .5 0
1
lue
.2
.3
.4
.5
5
0
Largest
.6
0
B
abe
0
.225
.2
K
J
aws
0
.2
1
ids
N
one
0
.2
C
lue
N
one
1
5
,
5
ig
B
ig
B
B
abe
ig
B
0
.4
0
.2
0
.5
0
.2
0
.3
1
0
.3
0
.5
0
.5
1
f(s1,1,s1,2,…,s2,1,s2,2,…) = mean(s1,1,s1,2,…,s2,1,s2,2,…)α*std(s1,1,s1,2,…,s2,1,s2,2,…)-β*diff(mean(s1,1,s1,2,…),mean(s2,1,s2,2,…))
10. Algorithm
Ratings
Table
Movies Similarity Matrix
C
K
J
B
lue
ids aws abe
Movies->
Users->
C
K
J
B
lue
ids aws abe
1
2
3
4
5
f(
5
3
N
one
4
N
3
one
C
B
1
5
lue
abe
21
4 0
.4
0
0
.3
0
N
one
1
4
3
1
4
0
.6 4
3
1
)=
0
0
.225
.2
1
0
0
Largest
.6
0
.5
5
0
.2
.2
.4
.5
5
0
.2
N
one
1
5
,
5
ig
B
.5
0
C
lue
1
K
0
ids
J
aws
B
abe
0
.2
.3
1
.2
0
0
0
.4
0
.3
ig
0
.5
0
.2
0
B
0
.3
0
Say.3
User 1 1 .2 Clue
likes
.3
.3
User 2 likes Babe
0
0
0
0
0
1
B .5 B
.4 C .2 K .2 J
B lue 0 ids 0 aws0 abe0 ig
1
0
ig C .5 1 .3 0 .3 0 .5 0
lue
.2
.3
.4
.5
ids
K
J
aws
0
1
.2
0
.3
0
.3
0
.2
1
.3
0
0
.3
0
.2
0
.3
number is for the movie Big. Users should watch it!
B
abe
ig
B
0
.4
0
.2
0
.5
0
.2
0
.3
1
0
.3
0
.5
0
.5
1