User Tools

Site Tools


mkatari-bioinformatics-august-2013-clustering

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
mkatari-bioinformatics-august-2013-clustering [2014/12/15 12:46] mkatarimkatari-bioinformatics-august-2013-clustering [2014/12/15 12:48] mkatari
Line 108: Line 108:
   for (i in 2:20) {   for (i in 2:20) {
      kmeans_tmp=kmeans(x, i, nstart=25)      kmeans_tmp=kmeans(x, i, nstart=25)
-     kmeans_ss[i] = kmeans_tmp$betweenss/kmeans_tmp$totss     +     #alternate way of looking at proportion of ss that is provided by between groups. 
-    +     #kmeans_ss[i] = kmeans_tmp$betweenss/kmeans_tmp$totss    
 + 
 +     #using silhouette width to evaluate clusters. 
 +     kmeans_sil= (kmeans_tmp$betweenss-kmeans_tmp$withinss)/max(kmeans_tmp$betweenss, kmeans_tmp$withinss)  
 +     kmeans_ss[i] = mean(kmeans_sil) 
 + 
   }   }
   return(kmeans_ss)   return(kmeans_ss)
mkatari-bioinformatics-august-2013-clustering.txt · Last modified: 2015/06/17 13:26 by mkatari