gpt4 book ai didi

python - tensorflow.contrib 中的 KMeans 与 KMeansClustering

转载 作者:太空宇宙 更新时间:2023-11-04 04:36:40 24 4
gpt4 key购买 nike

根据 tensorflow 的文档,有两个类与 Kmeans 算法相关。其中之一是 tensorflow.contrib.factorization.KMeans 另一个是tensorflow.contrib.factorization.KMeansClustering .该文档指出前者用于为 kmeans 聚类创建图形,但我实际上并没有得到它。我想对 MNIST 数据集使用 kmeans 来聚类数字然后对它们进行分类。我的代码应该使用哪个类?

最佳答案

我正在使用 sklearn 来完成这类工作,但通过文档,这是我的理解:

如您附加的示例中所示,KmeansClustering 以文本形式返回模型的结果:print 'point:', point, 'is in cluster', cluster_index, 'centered at', center

Kmeans 做完全相同的事情,但同时生成模型的统计数据和图表。

我建议您都尝试一下,看看自己的区别。

关于python - tensorflow.contrib 中的 KMeans 与 KMeansClustering,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51535128/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com