2×3+2×5+4×4≈0.924
显然,User 2 和 User 1、User 3、User 5 最相似。
使用与 User 2 最相似的三个 User 预测 User 2 的 Product 2。
r
ˉ
U
s
e
r
1
=
1
4
(
1
+
1
+
5
+
3
)
=
5
2
r
ˉ
U
s
e
r
2
=
1
3
(
3
+
5
+
3
)
=
4
r
ˉ
U
s
e
r
3
=
1
4
(
1
+
3
+
1
+
1
)
=
3
2
r
ˉ
U
s
e
r
5
=
1
4
(
2
+
2
+
2
+
4
)
=
5
2
begin{align} bar r_{rm User ;1} &= frac{1}{4}(1+1+5+3) = frac{5}{2} \ bar r_{rm User ;2} &= frac{1}{3} (3+5+3) = 4 \ bar r_{rm User ;3} &= frac{1}{4} (1+3+1+1) = frac{3}{2} \ bar r_{rm User ;5} &= frac{1}{4}(2+2+2+4) = frac{5}{2} end{align}
rˉUser1rˉUser2rˉUser3rˉUser5=41(1+1+5+3)=25=31(3+5+3)=4=41(1+3+1+1)=23=41(2+2+2+4)=25
r
U
s
e
r
2
,
P
r
o
u
2
=
r
ˉ
U
s
e
r
2
+
s
(
1
,
2
)
(
r
U
s
e
r
1
,
P
r
o
u
2
−
r
ˉ
U
s
e
r
1
)
+
s
(
3
,
2
)
(
r
U
s
e
r
3
,
P
r
o
u
c
2
−
r
ˉ
U
s
e
r
3
)
+
s
(
5
,
2
)
(
r
U
s
e
r
5
,
P
r
o
d
u
c
2
−
r
ˉ
U
s
e
r
5
)
s
(
1
,
2
)
+
s
(
3
,
2
)
+
s
(
5
,
2
)
≈
3.851
begin{align} r_{rm User ;2, Product ;2} &= bar r_{rm User ;2} + frac{{{rm sim(1,2)}(r_{rm User; 1, Product;2}- bar r_{rm User; 1}) } + {{rm sim(3,2)}(r_{rm User; 3, Product;2}- bar r_{rm User; 3})} + {{rm sim(5,2)}(r_{rm User; 5, Product;2}- bar r_{rm User; 5}) }}{rm sim(1,2) + sim(3,2)+ sim(5,2)} \ &≈ 3.851 end{align}
rUser2,Product2=rˉUser2+sim(1,2)+sim(3,2)+sim(5,2)sim(1,2)(rUser1,Product2−rˉUser1)+sim(3,2)(rUser3,Product2−rˉUser3)+sim(5,2)(rUser5,Product2−rˉUser5)≈3.851
Lab Part
Churn Management
churn_training.txt 文件包括 2000 条数据,churn_validation.txt 包括 1033 条数据。