聚集聚类散点图

时间:2020-04-26 19:15:14

标签: python hierarchical-clustering

我正在执行聚集聚类。我有一个模型,我将数据集拟合到该模型中,但是在可视化时出现错误。

from sklearn.cluster import AgglomerativeClustering

cluster = AgglomerativeClustering(n_clusters=16, affinity='euclidean', linkage='ward')

cluster.fit_predict(small)
import matplotlib.pyplot as plt

%matplotlib inline

plt.figure(figsize=(10, 7))
plt.scatter(small['tracks'], small['genre_top'], c=cluster.labels_, cmap='rainbow')

我得到这样的数组:

enter image description here

以及以下错误: enter image description here

0 个答案:

没有答案