余弦相似度:
c
o
s
(
θ
)
=
∑
i
=
1
n
(
x
i
×
y
i
)
∑
i
=
1
n
(
x
i
)
2
×
∑
i
=
1
n
(
y
i
)
2
cos(\theta) = {\sum_{i=1}^{n}{(x_i \times y_i)} \over {\sum_{i=1}^{n}{(x_i)^2} \times \sum_{i=1}^{n}{(y_i)^2}}}
cos(θ)=∑i=1n(xi)2×∑i=1n(yi)2∑i=1n(xi×yi)
cos(\theta) = {\sum_{i=1}^{n}{(x_i \times y_i)} \over {\sum_{i=1}{n}{(x_i)2} \times \sum_{i=1}{n}{(y_i)2}}}
均方误差:
M
S
E
(
y
,
y
’
)
=
∑
i
=
1
n
(
y
i
−
y
i
’
)
2
n
MSE(y,y^’) = {\sum_{i=1}^{n}{(y_i-y^’_i)^2} \over n}
MSE(y,y’)=n∑i=1n(yi−yi’)2
MSE(y,y^’) = {\sum_{i=1}{n}{(y_i-y’_i)^2} \over n}