【发布时间】:2018-09-28 09:39:11
【问题描述】:
使用 Python 3.6。使用曼哈顿距离进行相似性测量时,我没有得到合乎逻辑的结果。即使与 Pearson 和 Euclidean 相关的结果相比,Euclidean 和Manhattan 的单位看起来也不同?
我正在研究一个粗略的推荐模型,该模型涉及通过测量用户对首选项目 X 的评分与其他用户对同一项目的评分之间的相似性来推荐相似的项目,并推荐其他用户的项目,这些用户发现与之强匹配与提出请求的用户一起
我得到的结果是
Pearson:
[('Men in Black II', 0.12754201365635218), ('Fried Green Tomatoes', 0.11361596992427059), ('Miami Vice', 0.11068770878125743), ('The Dark', 0.11035867466994702), ('Comanche Station', 0.10994620915146613), ('Terminator 3: Rise of the Machines', 0.10802689932238932), ('Stand by Me', 0.10797224471029637), ('Dancer in the Dark', 0.10241410378191894), ('Los Olvidados', 0.10044018848844877), ('A Shot in the Dark', 0.10036315249837004)]
Euclidean:
[('...And the Pursuit of Happiness', 1.0), ('12 Angry Men', 1.0), ('4 Little Girls', 1.0), ('4교시 추리영역', 1.0), ('8MM', 1.0), ('A Band Called Death', 1.0), ('A Blank on the Map', 1.0), ('A Dandy in Aspic', 1.0), ('A Date with Judy', 1.0), ('A Zona', 1.0)]
Manhattan:
[('...And the Pursuit of Happiness', 1.0), ('12 Angry Men', 1.0), ('4 Little Girls', 1.0), ('4교시 추리영역', 1.0), ('8MM', 1.0), ('A Band Called Death', 1.0), ('A Blank on the Map', 1.0), ('A Dandy in Aspic', 1.0), ('A Date with Judy', 1.0), ('A Zona', 1.0)]
Cosine:
[('...And the Pursuit of Happiness', 1.0), ('4 Little Girls', 1.0), ('4교시 추리영역', 1.0), ('8MM', 1.0), ('A Band Called Death', 1.0), ('A Blank on the Map', 1.0), ('A Dandy in Aspic', 1.0), ('A Date with Judy', 1.0), ('A Zona', 1.0), ('A.I. Artificial Intelligence', 1.0)]
【问题讨论】:
标签: python statistics similarity euclidean-distance pearson