【发布时间】:2018-02-19 16:34:15
【问题描述】:
我正在使用 sklearn DBSCAN 对我的数据进行如下聚类。
#Apply DBSCAN (sims == my data as list of lists)
db1 = DBSCAN(min_samples=1, metric='precomputed').fit(sims)
db1_labels = db1.labels_
db1n_clusters_ = len(set(db1_labels)) - (1 if -1 in db1_labels else 0)
#Returns the number of clusters (E.g., 10 clusters)
print('Estimated number of clusters: %d' % db1n_clusters_)
现在我想从大小(每个集群中的数据点数)排序前 3 个集群。请让我知道如何在 sklearn 中获取集群大小?
【问题讨论】:
标签: python machine-learning scikit-learn cluster-analysis dbscan