[R] [klaR packages] Weighted kmodes (how to derive the weights?)

이아름 judyoringe at naver.com
Sat Dec 12 04:29:03 CET 2015

How can I found the specific outcome of weighted k-modes? 
​i did the cluster analysis with weighted kmodes(klaR packages)
a<-kmodes(data, 5, TRUE)
What i want to see is not only the result of clustering but the result of "weight for each attributes".
I found the code for kmodes(https://github.com/cran/klaR/blob/master/R/kmodes.R#L124)
and below codes seems to save the weights for each attribute..
but i do not know exactly how to extract this result by adding another R command... 
  if(weighted){        ## compute the frequencies of each category for each variable        weights <- vector("list", num_var)        for (i in 1:num_var)             weights[[i]] <- table(data[,i])    } else {        weights <- NULL    }     
Thanks all!!

	[[alternative HTML version deleted]]

More information about the R-help mailing list