code_6.py 152 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2
kmeansmodel = KMeans(n_clusters= 4, init='k-means++') # 选择4作为聚类个数
y_kmeans= kmeansmodel.fit_predict(X) # 进行聚类的拟合和分类