我试图理解Wolfram documentation中的标准化欧氏距离公式:
1/2*Norm[(u-Mean[u])-(v-Mean[v])]^2/(Norm[u-Mean[u]]^2+Norm[v-Mean[v]]^2)
我在网上搜索了这个公式,但无法找到它。有人可以解释这个公式是如何得出的吗?
答案 0 :(得分:1)
此公式的含义如下:
长度已缩放到的两个向量之间的距离 有单位规范。当向量的方向是时,这是有用的 有意义,但幅度不大。
https://stats.stackexchange.com/questions/136232/definition-of-normalized-euclidean-distance
答案 1 :(得分:0)
除了Luca的评论之外,这里有一个例子,显示“两个向量之间的距离,其长度已被缩放为具有单位范数”。它不等于归一化的平方欧几里德距离。前者在下图中为蓝色。标准欧氏距离为红色。
(* Leave this unevaluated to see symbolic expressions *)
{{a, b, c}, {d, e, f}} = {{1, 2, 3}, {3, 5, 10}};
N[EuclideanDistance[{a, b, c}, {d, e, f}]]
7.87401
Norm[{a, b, c} - {d, e, f}]
SquaredEuclideanDistance[{a, b, c}, {d, e, f}]
Norm[{a, b, c} - {d, e, f}]^2
N[NormalizedSquaredEuclideanDistance[{a, b, c}, {d, e, f}]]
0.25
(1/2 Norm[({a, b, c} - Mean[{a, b, c}]) - ({d, e, f} - Mean[{d, e, f}])]^2)/
(Norm[{a, b, c} - Mean[{a, b, c}]]^2 + Norm[{d, e, f} - Mean[{d, e, f}]]^2)
1/2 Variance[{a, b, c} - {d, e, f}]/(Variance[{a, b, c}] + Variance[{d, e, f}])
{a2, b2, c2} = Normalize[{a, b, c}];
{d2, e2, f2} = Normalize[{d, e, f}];
N[EuclideanDistance[{a2, b2, c2}, {d2, e2, f2}]]
0.120185
Graphics3D[{Line[{{0, 0, 0}, {1, 2, 3}}],
Line[{{0, 0, 0}, {3, 5, 10}}],
Red, Thick, Line[{{1, 2, 3}, {3, 5, 10}}],
Blue, Line[{{a2, b2, c2}, {d2, e2, f2}}]},
Axes -> True, AspectRatio -> 1,
PlotRange -> {{0, 10}, {0, 10}, {0, 10}},
AxesLabel -> Map[Style[#, Bold, 16] &, {"x", "y", "z"}],
AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}},
ViewPoint -> {1.275, -2.433, -1.975},
ViewVertical -> {0.551, -0.778, 0.302}]