python聚类算法kmeansfrom sklearn.cluster import KMeans
estimator =KMeans(n_clusters=3)
estimator.fit(data)
label_pred = estimator.labels_#聚类标签
centroids = estimator.cluster_centers_#聚类中心
2024-03-16 11:22:52
python聚类算法kmeansfrom sklearn.cluster import KMeans
estimator =KMeans(n_clusters=3)
estimator.fit(data)
label_pred = estimator.labels_#聚类标签
centroids = estimator.cluster_centers_#聚类中心