python聚类算法kmeans
from sklearn.cluster import KMeans
estimator =KMeans(n_clusters=3)
estimator.fit(data)
label_pred = estimator.labels_#聚类标签
centroids = estimator.cluster_centers_#聚类中心
python聚类算法kmeans
from sklearn.cluster import KMeans
estimator =KMeans(n_clusters=3)
estimator.fit(data)
label_pred = estimator.labels_#聚类标签
centroids = estimator.cluster_centers_#聚类中心