如何使用python中的数学模块查找余弦距离

问题描述 投票:0回答:1

有两点,即S =(x,y),P =(p,q)

  1. 如何在导入数学模块或不导入Python数学模块的情况下找到余弦距离?
  2. 哪种会更有效?

请回答python3编程

python python-3.x math python-requests python-module
1个回答
0
投票

使用scikit学习,它比使用python数学模块更加优化。

https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.cosine_distances.html

© www.soinside.com 2019 - 2024. All rights reserved.