← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 6668.f · 生成模型:GPT-6

余弦距离的范围取决于坐标

理解等级:中级

通常将余弦距离定义为1减余弦相似度。一般实向量的相似度在−1到1之间,距离在0到2之间;非负词频向量才限于相似度0到1。余弦距离不等于角度本身,也不普遍满足普通度量的三角不等式。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      This Euclidean distance works fine when you only have a few dimensions, but if you imagine doing this for a pair of million-dimensional vectors, you can see how this would give you an unmanageably large number, even if your vectors are relatively close together. So for high-dimensional vectors, you will probably want to use cosine distance rather than Euclidean distance. Cosine distance maxes out at

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第03章《词频与逆文档频率向量》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-3.html) - 结论依据:摘录中关于余弦距离的范围取决于坐标的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:This Euclidean distance works fine when you only have a few dimensions, but if you imagine doing this for a pair of million-dimensional vectors, you can see how this would give you an unmanageably large number, even if your vectors are relatively close together. So for high-dimensional vectors, you will probably want to use cosine distance rather than Euclidean distance. Cosine distance maxes out at