k-means聚类个数k的确定

参考博文链接:
使用Python的机器学习库tslearn对时间序列数据进行聚类
https://blog.brains-tech.co.jp/entry/tslearn-time-series-clustering

参考文献;以及参考网站:
tslearn’s documentation — tslearn 0.1.18.3 documentation
链接:http://tslearn.readthedocs.io/en/latest/index.html
Silhouette (clustering) - Wikipedia
链接:https://en.wikipedia.org/wiki/Silhouette_(clustering)
k-means最佳集群个数方法:
https://qiita.com/deaikei/items/11a10fde5bb47a2cf2c2
在Python从集群k-means改进k-medoids -见习数据科学家的隐蔽之处
链接:http://www.dskomei.com/entry/2018/04/03/004543
X-means: Extending K-means with Efficient Estimation of the Number of Clusters
链接:http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.19.3377&rep=rep1&type=pdf

Estimating the number of clusters in a data set via the gap statistic
https://statweb.stanford.edu/~gwalther/gap

Determining the number of clusters in a data set - Wikipedia
决定集群数的维基百科地址
https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set

Elbow method (clustering) - Wikipedia:手肘法的百科
https://en.wikipedia.org/wiki/Elbow_method_(clustering)

手肘法简介:
基于python:https://blog.brains-tech.co.jp/entry/tslearn-time-series-clustering

基于matlab:https://blog.csdn.net/qq_23860475/article/details/80666982

手肘法部分代码python
distortions = []

#1~10クラスタまで計算
for i in range(1,11):
ks = KShape(n_clusters=i, n_init=10, verbose=True, random_state=seed)
#クラスタリングの計算を実行
ks.fit(stack_data)
#ks.fitするとks.inertia_が得られる
#inertia_でSSEを取得できる
distortions.append(ks.inertia_)

plt.plot(range(1,11), distortions, marker=‘o’)
plt.xlabel(‘Number of clusters’)
plt.ylabel(‘Distortion’)
plt.show()

猜你喜欢

转载自blog.csdn.net/JiangLongShen/article/details/88636897