Professional Documents
Culture Documents
E-commerce
GE2338 Internet Applications and Security
Q1: Cosine-based similarity (1/2)
➢Given the rating matrix with n users and m items as below, find out the
missing similarity values.
σ𝑛𝑘=1 𝑣𝑘𝑖 ∗ 𝑣𝑘𝑗
𝑠𝑖𝑚 𝑖, 𝑗 =
σ𝑛𝑘=1 𝑣𝑘𝑖
2
∗ σ𝑛𝑘=1 𝑣𝑘𝑗
2
item pj
1 2 3 4 5
1 0 4 2 2 0
2 0 3 0 3 0
user ui
3 4 1 3 0 5
4 3 0 0 0 4
GE2338 © 2018 By Dr. Chi-Yin Chow 2
Q1: Cosine-based similarity (2/2)
➢Similarity matrix
1 2 3 4 5
1 - 0.16 0.67 0.00 ?
2 0.16 - 0.60 ? 0.15
3 0.67 0.60 - 0.31 0.65
4 0.00 ? 0.31 - 0.00
5 ? 0.15 0.65 0.00 -
GE2338 © 2018 By Dr. Chi-Yin Chow 3
Q2: Rating Prediction
➢Predict the rating for user u4 on items p2, p3 and p4.
∗
σ𝑚
𝑗=1, 𝑖≠𝑗 𝑠𝑖𝑚 𝑖, 𝑗 ∗ 𝑣𝑘𝑗
𝑣𝑘𝑖 =
σ𝑚𝑗=1,𝑖≠𝑗 𝑠𝑖𝑚(𝑖, 𝑗)