diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-06-08 20:28:08 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-06-08 20:28:08 -0300 |
commit | 45a48e4737cc5bd7f5b117cb61d261c52e1634d2 (patch) | |
tree | 3e03beaf96ac328944150f9bdd0281dfea425354 | |
parent | 945d4517d9a86c889ae5f887dd20d1ebedd862f7 (diff) |
Fixed silhouette coefficient calculation.
-rw-r--r-- | measures.R | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -65,11 +65,11 @@ silhouette <- function(Dy, labels) { for (i in 1:n) { label <- labels[i] - cohesion[i] <- mean(Dy[i, labels[-i] == label]) separation[i] <- min(Dy[i, labels != label]) + cohesion[i] <- mean(Dy[i, labels[-i] == label]) } - silh <- (cohesion - separation) / max(cohesion, separation) + silh <- (separation - cohesion) / max(separation, cohesion) } d2p <- function(D, perplexity = 9, tol = 1e-5, max.tries = 50) { |