from sklearn.cluster import KMeans
from VGGAE import autoencoder
import pandas as pd
train_data = autoencoder()
train_x = pd.DataFrame(train_data)
train_x = train_x.iloc[:, :-1]
print(train_x)
clf = KMeans(n_clusters=1, n_init='auto')
clf.fit(train_x)
print(clf.cluster_centers_)
print(clf.labels_)
pre = clf.fit_predict(train_x)
print(pre)
基于自编码器的k-means聚类
最新推荐文章于 2024-11-18 00:00:00 发布