def computeDistance(X, Y, method):
if method == 'cosine':
dist = spdistance.cosine(X,Y)
if dist < 0:
print ('WARNING: distance between X {} and Y {} = {} < 0, method: '
'{}'.format(X, Y, dist, method))
return dist
评论列表
文章目录