赞
踩
def compute_dist(array1, array2, type='euclidean'):
#type='euclidean'代表是计算欧式距离,type='euclidean'代表是余弦相似性
# """Compute the euclidean or cosine distance of all pairs.return dist
#以下函数主要是根据属性距离来计算寻找两个属性之间的距离最近的 并且判断是不是同一个类别,如果是一个类别,就是test正确,并且correct加一。
correct = 0
for i in range(2966):Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。