我有一个图像数据集,我提取了 9 个数字特征,我想应用 k 均值聚类或层次聚类。我只是不知道该怎么做。我读过的教程都只有 2 或 3 个特性,因此很容易应用和绘制图表。任何帮助,将不胜感激
这是我到目前为止的代码:
numpyArr = df.values
ms = MeanShift()
ms.fit(numpyArr)
labels = ms.labels_
cluster_centers = ms.cluster_centers_
n_clusters_ = len(np.unique(labels))
print("Number of estimated clusters:", n_clusters_)