2018年3月23日

相似度与距离计算python代码实现

摘要: 1 #定义几种距离计算函数 2 #更高效的方式为把得分向量化之后使用scipy中定义的distance方法 3 4 from math import sqrt 5 def euclidean_dis(rating1, rating2): #欧式距离计算 6 """计算2个打分序列间的欧式距离. 输入的rating1和rating2都是打分dict 7 ... 阅读全文

posted @ 2018-03-23 22:24 NothingLZ 阅读(3580) 评论(0) 推荐(0) 编辑

导航