-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
提供推荐 | 广阔天地,大有作为 #4
Comments
比课本讲的好不过,协方差是怎么求来着完全忘记了:( |
@SofiaxCh 那你看了这篇文章,记起来没有? |
HHHa 你那段解释写的很好,我就记住了向量标准化再cos的公式,可以嘛?要用的时候应该调Numpy库就可以啦 |
皮尔逊相似度,就是概率论的相关系数。皮尔逊是个人名,这个相关系数的公式是他发明的。也就是向量标准化再求余弦。两个是一样的。学会一个就会另一个。 from numpy import *
vc=[1,2,39,0,8]
vb=[1,2,38,0,8]
mean(multiply((vc-mean(vc)),(vb-mean(vb))))/(std(vb)*std(vc))
#0.999986231331
#numpy.corrcoef得到相关系数矩阵(向量的相似程度)
numpy.corrcoef(vc,vb)
#[[ 1. 0.99998623]
# [ 0.99998623 1. ]]
# 这里得到是相关系数矩阵
#左上角的[0][0]代表第一行和第一行的相关系数,[0][1]代表第一行和第二行的相关系数
#左下角的[1][0]代表第二行和第一行的相关系数,[1][1]代表第二行和第二行的相关系数 |
李教授写的好细致哦,这次马马虎虎看懂了,那个,标准差公式是不是掉了一个平方呀? |
@SofiaxCh 还真是这样子呐!能发现错误,很棒! |
算物品与物品的相似度,还可以给用户提供相似推荐 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://laiqun.github.io/2017/11/05/Marking-Recommendations/
The text was updated successfully, but these errors were encountered: