
Last chance! 50% off unlimited learning
Sale ends in
cluster.stats
.calinhara(x,clustering,cn=max(clustering))
(n-cn)*sum(diag(B))/((cn-1)*sum(diag(W)))
. B being the
between-cluster means,
and W being the within-clusters covariance matrix.cluster.stats
set.seed(98765)
iriss <- iris[sample(150,20),-5]
km <- kmeans(iriss,3)
calinhara(iriss,km$cluster)
Run the code above in your browser using DataLab