【发布时间】:2017-04-28 09:56:18
【问题描述】:
我想通过单一链接运行层次聚类,以对具有 300 个特征和 1500 个观察值的聚类文档进行聚类。我想找到这个问题的最佳聚类数。
以下链接使用以下代码查找具有最大间隙的簇数。
# Compute gap statistic
set.seed(123)
iris.scaled <- scale(iris[, -5])
gap_stat <- clusGap(iris.scaled, FUN = hcut, K.max = 10, B = 50)
# Plot gap statistic
fviz_gap_stat(gap_stat)
但是在链接中hcut没有明确定义。如何为clusGap() 函数指定单链接层次聚类?
我们在 python 中是否有 clusGap() 的等价物?
谢谢
【问题讨论】:
标签: python r cluster-analysis hierarchical-clustering unsupervised-learning