Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 k 均值聚类的距离度量更改为堪培拉距离或任何其他距离度量?据我了解,sklearn 只支持欧几里得距离,而 nltk 似乎不支持堪培拉距离,但我可能错了。谢谢!
from scipy.spatial import distance from nltk.cluster.kmeans import KMeansClusterer obj = KMeansCluster(num_cluster, distance = distance.canberra)