【发布时间】:2016-09-26 04:32:31
【问题描述】:
我有来自 word2vec 模型的 500 暗度和 1000 暗度的词向量。我正在计算 500 和 1000 暗淡的一些示例向量之间的欧几里得距离。我的问题是我读过关于维度诅咒的论文:欧几里得距离在高维空间中不起作用。但在这里,两个维度的结果非常相似。 我计算了 1000 个暗向量之间的欧几里得距离:
distance beween girl and boy
18.1915241847
cosine between girl and boy
0.785652955784
l1 distance beween girl and boy
18.1915241847
distance between girl and neither
35.549272401
cosine between girl and neither
-0.0117403359958
distance between boy and neither
34.5523976193
cosine between boy and neither
-0.0129663966118
distance between girl and charger
28.65625576
cosine between girl and charger
0.119322070804
distance between either and neither
25.1379275604
cosine between either and neither
0.357230346462
在 500 暗处是:
distance between girl and boy
13.9897543378
cosine between girl and boy 0.864196148736
l1 distance between girl and boy
13.9897543378
distance between girl and neither
35.1385895164
cosine between girl and neither
-0.000815672156041
distance between boy and neither
34.1677078497
cosine between boy and neither
0.00703764567668
distance between girl and charger
27.689731876
cosine between girl and charger
0.113056294897
distance between either and neither
0.0
cosine between either and neither
1.0
有人可以解释为什么会这样吗?是不是跟稀缺有关?
【问题讨论】:
-
“欧几里得距离在高维空间中不起作用”——这不是维度的诅咒。
-
我已阅读 Aggarwal、Hinneburg 和 Keim 的《关于高维空间中距离度量的令人惊讶的行为》。
-
实际上没有理由欧几里得距离不起作用,在数学意义上。但是一个不确定的系统,也许是你的情况,通常有无用的变量,摆脱它们通常会提高回归器/分类器的性能。你应该寻找模型选择,降维,主成分分析。
-
还有一点是:随着变量数量的增加,获得线性可分问题的机会也会增加,但变量过多可能会插入不相关的信息。当你持有这些无用的变量时,你就有了一个非空间模型。
-
@DavidClifte 据我所知,在更高的暗度平均值中,最小和最大距离是相同的。但是,这可能是在稀疏数据的情况下。但这是我的问题
标签: python python-2.7 machine-learning word2vec