问题
I just started working with the kml
package to perform longitudinal k-means clustering in R
.
By default the kml
function uses the Calinski Harabatz Sorted
criterion to choose the 'best' clustering. So by accessing the 'best' clustering you will always see the Calinski Harabatz Sorted
criterion.
How can we choose another quality criterion?
A minimal example:
library(kml)
# some data
cld <- generateArtificialLongData(25)
# perform clustering
kml(cold)
# choose the 'best' clustering:
choice(cld)
This plots something like:
So we see the actual data, clustering and on the left side the quality criterion. Now for 'Calinski Harabatz Unsorted' the 'optimal' number is four clusters. But what if we choose another quality criterion?
To plot another solution with a differing number of clusters I can for example do:
plot(cld, 3, toPlot = 'both')
So here we see a clustering with three clusters and still the same criterion from above.
How can we plot the quality criterion for another measure, e.g. Ray and Turie?
来源:https://stackoverflow.com/questions/61323782/how-to-choose-and-plot-the-quality-criterion-in-kml-function