R 硬竞争学习集群(flexclust软件包)无收敛性

R 硬竞争学习集群(flexclust软件包)无收敛性,r,cluster-analysis,k-means,R,Cluster Analysis,K Means,我正在将flexclust包中的函数应用于硬竞争学习集群,我在收敛方面遇到了问题 我使用这个算法是因为我在寻找一种方法来执行加权聚类,给变量组赋予不同的权重。我根据对前一个问题的回答()选择了艰苦竞争学习 我试图找到最佳的集群数量,为此,我使用函数stepFlexclust和以下代码: new("flexclustControl") ## check the default values fc_control <- new("flexclustControl") fc_control@i

我正在将flexclust包中的函数应用于硬竞争学习集群,我在收敛方面遇到了问题

我使用这个算法是因为我在寻找一种方法来执行加权聚类,给变量组赋予不同的权重。我根据对前一个问题的回答()选择了艰苦竞争学习

我试图找到最佳的集群数量,为此,我使用函数stepFlexclust和以下代码:

new("flexclustControl") ## check the default values

fc_control <- new("flexclustControl")
fc_control@iter.max <- 500 ### 500 iterations
fc_control@verbose <- 1 # this will set the verbose to TRUE
fc_control@tolerance <- 0.01

### I want to give more weight to the first 24 variables of the dataframe
my_weights <-  rep(c(1, 0.064), c(24, 31)) 

set.seed(1908)
hardcl <- stepFlexclust(x=df, k=c(7:20), nrep=100, verbose=TRUE, 
              FUN = cclust, dist = "euclidean", method = "hardcl", weights=my_weights, #Parameters for hard competitive learning
              control = fc_control,
              multicore=TRUE)
new(“flexclustControl”)##检查默认值

fc_control两件事回答了我的问题(以及对kmeans加权变量的评论,或者更确切地说,是对艰苦竞争学习的评论):

  • 权重用于观察(=x行),而不是变量(=x列)。因此,使用hardcl对变量进行加权是错误的

  • 在hardcl或neural gas中,与标准的k-means相比,您需要更多的迭代:在k-means中,一次迭代使用完整的数据集来改变质心,硬竞争学习,并且只使用一次观察。与k-means相比,将迭代次数乘以样本量