问题描述
我正在尝试在R中使用PAM算法在类固醇周围形成簇。无论如何,是否有固定PAM的簇大小(有点强行簇大小)的问题?有没有其他的聚类算法可以为类固醇提供相同大小的聚类?
I am trying to form clusters around medoids using PAM algorithm in R. Is there anyway of fixing the cluster size for PAM (somewhat bruteforce the cluster size) ? Are there any other clustering algorithms that will provide equal sized clusters for medoids ?
在此先感谢您的帮助。
推荐答案
您可以修改聚类算法以适合您的需求。
You can modify a clustering algorithm to suit your needs.
您可以按照以下步骤操作,或直接从ELKI中的教程
程序包/模块(从GitHub构建最新版本,因为我刚刚修复了一个错误-该错误将包含在ELKI 0.7.2中)。
You can follow this Tutorial for Same-Size K-Means, or simply use this algorithm from the tutorial
package/module in ELKI (build the latest version from GitHub, because I just fixed a bug there - this will be included in ELKI 0.7.2).
本质上,此算法执行k均值样式最小二乘法优化,但是所有聚类必须具有相同的大小(如果N / k不是整数,则聚类大小可能会有所不同1)。
Essentially, this algorithm performs a k-means style least-squares optimization, but all clusters must have the same size (if N/k is not integer, the cluster sizes may vary by 1).
如果转到上面的教程并滚动到底部,则可以看到示例结果。
If you go to above tutorial and scroll to the bottom, you can see example results.
这篇关于获得相等大小聚类的聚类算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!