1
$\begingroup$

I am using the PAM function in R, and I don't understand how to evaluate its output. Whereas in K-means the ratio between the between sum of squares to the total sum of squares already gives a very good insight into the outcome of the function, PAM has no such measure in its output. How can I assess if the model is good or bad?

$\endgroup$
1
$\begingroup$

You may look at the silhouette plot

library(cluster)

## generate 25 objects, divided into 2 clusters.
x <- rbind(cbind(rnorm(10,0,0.5), rnorm(10,0,0.5)),
           cbind(rnorm(15,5,0.5), rnorm(15,5,0.5)))
pamx <- pam(x, 2)

spam <- silhouette(pamx)
plot(spam)

enter image description here

You can get one value using:

mean(spam[,3])

Giving 0.880. (The value is between -1 to 1. While 1 means perfect clusters, and the lower it gets the less good the clusters are)

$\endgroup$
  • 1
    $\begingroup$ This is precisely what I was looking for! It's a bit late for my master thesis, but it will be handy in the upcoming article! Thanks! $\endgroup$ – rsy Feb 8 '16 at 9:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.