可以将两个对象具有相同的余弦和Tanimoto系数距离度量,其中
Tanimoto distance measure, d(x,y) = x.y / (|x|*|x|) + (|y|*|y|)- x*y和
cosine measure, d(x,y) = x.y /(|x|* |x|) * (|y| *|y|)Can two objects have identical cosine and Tanimoto coefficient distance measure, where
Tanimoto distance measure, d(x,y) = x.y / (|x|*|x|) + (|y|*|y|)- x*yand
cosine measure, d(x,y) = x.y /(|x|* |x|) * (|y| *|y|)最满意答案
Tanimoto相似系数 ( 不是真正的距离测量)由下式定义
d(x,y) = x.y / ((|x|*|x|) + (|y|*|y|)- x.y)对于位向量x和y。
现在将其与余弦相似系数进行比较,
d(x,y) = x.y / (|x| * |y|)分母因xy项而异。 如果xy为零,则Tanimoto和余弦相似系数将相同。
几何上,当且仅当x和y垂直时, xy为零。
由于x和y是位向量(即每个维度中的值只能是0或1),因此xy等于零意味着
x1*y1 + x2*y2 + ... + xn*yn = 0如果xi * yi = 1 * 1 = 1,那么整个总和将为正。 要使整个总和为零,则没有术语 xi * yi等于1.它们必须全部等于0:
所以
x1*y1 = 0 x2*y2 = 0 ... xn*yn = 0换句话说,如果xi是1,那么yi必须是0,反之亦然。
因此,有很多例子,Tanimoto相似度等于余弦相似度:
x = (0,1,0,1) y = (1,0,0,0)例如。
The Tanimoto similarity coefficient (which is not a true distance measure) is defined by
d(x,y) = x.y / ((|x|*|x|) + (|y|*|y|)- x.y)for bit vectors x and y.
Now compare that with the cosine similarity coefficent,
d(x,y) = x.y / (|x| * |y|)The denominators differ by a x.y term. The Tanimoto and cosine similarity coefficients would be the same if x.y is zero.
Geometrically, x.y is zero if and only if x and y are perpendicular.
Since x and y are bit vectors (i.e. whose values in each dimension can only be 0 or 1), x.y equalling zero means
x1*y1 + x2*y2 + ... + xn*yn = 0If xi*yi = 1*1 = 1, then the whole sum would be positive. For the whole sum to be zero, no term xi*yi can equal 1. They must all equal 0:
So
x1*y1 = 0 x2*y2 = 0 ... xn*yn = 0In other words, if xi is 1, then yi must be 0, and vice versa.
So there are tons of examples where the Tanimoto similarity is equal to the cosine similarity:
x = (0,1,0,1) y = (1,0,0,0)for instance.
更多推荐
发布评论