ClusterStability: Calculates the approximate stability score (_ST_) of...

Description Usage Arguments Value Examples

View source: R/ClusterStability.R

Description

This function will return the individual stability score ST and the global score STglobal using either the K-means or K-medoids algorithm and four different clustering indices: Calinski-Harabasz, Silhouette, Dunn or Davies-Bouldin.

Usage

1

Arguments

dat

the input dataset: either a matrix or a dataframe.

k

the number of classes for the K-means or K-medoids algorithm (default=3).

replicate

the number of replicates to perform (default=1000).

type

the algorithm used in the partitioning: either 'kmeans' or 'kmedoids' algorithm (default=kmeans).

Value

Returns the individual (ST) and global (ST_global) stability scores for the four clustering indices: Calinski-Harabasz (ch), Silhouette (sil), Dunn (dunn) or Davies-Bouldin (db).

Examples

1
2
3
   ## Calculates the stability scores of individual objects of the Iris dataset
   ## using K-means, 100 replicates (random starts) and k=3
   ClusterStability(dat=iris[1:4],k=3,replicate=100,type='kmeans');

Example output

Loading required package: Rcpp
Loading required package: clusterCrit
Loading required package: cluster
Loading required package: copula
Loading required package: WeightedCluster
Loading required package: TraMineR

TraMineR stable version 2.0-7 (Built: "Sat,)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

This is WeightedCluster stable version 1.2-1 (Built: 2017-09-21)

To get the manuals, please run:
   vignette("WeightedCluster") ## Complete manual in English
   vignette("WeightedClusterFR") ## Complete manual in French
   vignette("WeightedClusterPreview") ## Short preview in English

To cite WeightedCluster in publications please use:
Studer, Matthias (2013). WeightedCluster Library Manual: A practical
   guide to creating typologies of trajectories in the social sciences
   with R. LIVES Working Papers, 24. doi:
   10.12682/lives.2296-1658.2013.24
$ST_ch
  [1] 0.9799363 0.9603775 0.9603775 0.9603775 0.9799363 0.9799363 0.9603775
  [8] 0.9799363 0.9603775 0.9603775 0.9799363 0.9796160 0.9603775 0.9603775
 [15] 0.9799363 0.9799363 0.9799363 0.9799363 0.9799363 0.9799363 0.9799363
 [22] 0.9799363 0.9796160 0.9799363 0.9606978 0.9603775 0.9799363 0.9799363
 [29] 0.9799363 0.9603775 0.9603775 0.9799363 0.9799363 0.9799363 0.9603775
 [36] 0.9796160 0.9799363 0.9799363 0.9603775 0.9799363 0.9799363 0.9603775
 [43] 0.9603775 0.9799363 0.9799363 0.9603775 0.9799363 0.9603775 0.9799363
 [50] 0.9796160 0.5484186 0.9127440 0.8774193 0.9127440 0.9127440 0.9127440
 [57] 0.9127440 0.8944169 0.9127440 0.9127440 0.9005014 0.9127440 0.9127440
 [64] 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440
 [71] 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440
 [78] 0.8774193 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440
 [85] 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440 0.9127440
 [92] 0.9127440 0.9127440 0.8944169 0.9127440 0.9127440 0.9127440 0.9127440
 [99] 0.8944169 0.9127440 0.8774193 0.9127440 0.8774193 0.8774193 0.8774193
[106] 0.8774193 0.9127440 0.8774193 0.8774193 0.8774193 0.8774193 0.8774193
[113] 0.8774193 0.9127440 0.9127440 0.8774193 0.8774193 0.8774193 0.8774193
[120] 0.9127440 0.8774193 0.9127440 0.8774193 0.9127440 0.8774193 0.8774193
[127] 0.9127440 0.9127440 0.8774193 0.8774193 0.8774193 0.8774193 0.8774193
[134] 0.9127440 0.8774193 0.8774193 0.8774193 0.8774193 0.9127440 0.8774193
[141] 0.8774193 0.8774193 0.9127440 0.8774193 0.8774193 0.8774193 0.9127440
[148] 0.8774193 0.8774193 0.9127440

$ST_sil
  [1] 0.9651703 0.9311315 0.9311315 0.9311315 0.9651703 0.9651703 0.9311315
  [8] 0.9651703 0.9311315 0.9311315 0.9651703 0.9646200 0.9311315 0.9311315
 [15] 0.9651703 0.9651703 0.9651703 0.9651703 0.9651703 0.9651703 0.9651703
 [22] 0.9651703 0.9646200 0.9651703 0.9316819 0.9311315 0.9651703 0.9651703
 [29] 0.9651703 0.9311315 0.9311315 0.9651703 0.9651703 0.9651703 0.9311315
 [36] 0.9646200 0.9651703 0.9651703 0.9311315 0.9651703 0.9651703 0.9311315
 [43] 0.9311315 0.9651703 0.9651703 0.9311315 0.9651703 0.9311315 0.9651703
 [50] 0.9646200 0.5837015 0.8522369 0.7905919 0.8522369 0.8522369 0.8522369
 [57] 0.8522369 0.8204691 0.8522369 0.8522369 0.8309261 0.8522369 0.8522369
 [64] 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369
 [71] 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369
 [78] 0.7905919 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369
 [85] 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369 0.8522369
 [92] 0.8522369 0.8522369 0.8204691 0.8522369 0.8522369 0.8522369 0.8522369
 [99] 0.8204691 0.8522369 0.7905919 0.8522369 0.7905919 0.7905919 0.7905919
[106] 0.7905919 0.8522369 0.7905919 0.7905919 0.7905919 0.7905919 0.7905919
[113] 0.7905919 0.8522369 0.8522369 0.7905919 0.7905919 0.7905919 0.7905919
[120] 0.8522369 0.7905919 0.8522369 0.7905919 0.8522369 0.7905919 0.7905919
[127] 0.8522369 0.8522369 0.7905919 0.7905919 0.7905919 0.7905919 0.7905919
[134] 0.8522369 0.7905919 0.7905919 0.7905919 0.7905919 0.8522369 0.7905919
[141] 0.7905919 0.7905919 0.8522369 0.7905919 0.7905919 0.7905919 0.8522369
[148] 0.7905919 0.7905919 0.8522369

$ST_dunn
  [1] 0.9809215 0.9605719 0.9605719 0.9605719 0.9809215 0.9809215 0.9605719
  [8] 0.9809215 0.9605719 0.9605719 0.9809215 0.9807300 0.9605719 0.9605719
 [15] 0.9809215 0.9809215 0.9809215 0.9809215 0.9809215 0.9809215 0.9809215
 [22] 0.9809215 0.9807300 0.9809215 0.9607634 0.9605719 0.9809215 0.9809215
 [29] 0.9809215 0.9605719 0.9605719 0.9809215 0.9809215 0.9809215 0.9605719
 [36] 0.9807300 0.9809215 0.9809215 0.9605719 0.9809215 0.9809215 0.9605719
 [43] 0.9605719 0.9809215 0.9809215 0.9605719 0.9809215 0.9605719 0.9809215
 [50] 0.9807300 0.5420573 0.9142438 0.8803374 0.9142438 0.9142438 0.9142438
 [57] 0.9142438 0.8977771 0.9142438 0.9142438 0.9014159 0.9142438 0.9142438
 [64] 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438
 [71] 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438
 [78] 0.8803374 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438
 [85] 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438 0.9142438
 [92] 0.9142438 0.9142438 0.8977771 0.9142438 0.9142438 0.9142438 0.9142438
 [99] 0.8977771 0.9142438 0.8803374 0.9142438 0.8803374 0.8803374 0.8803374
[106] 0.8803374 0.9142438 0.8803374 0.8803374 0.8803374 0.8803374 0.8803374
[113] 0.8803374 0.9142438 0.9142438 0.8803374 0.8803374 0.8803374 0.8803374
[120] 0.9142438 0.8803374 0.9142438 0.8803374 0.9142438 0.8803374 0.8803374
[127] 0.9142438 0.9142438 0.8803374 0.8803374 0.8803374 0.8803374 0.8803374
[134] 0.9142438 0.8803374 0.8803374 0.8803374 0.8803374 0.9142438 0.8803374
[141] 0.8803374 0.8803374 0.9142438 0.8803374 0.8803374 0.8803374 0.9142438
[148] 0.8803374 0.8803374 0.9142438

$ST_db
  [1] 0.9743487 0.9494815 0.9494815 0.9494815 0.9743487 0.9743487 0.9494815
  [8] 0.9743487 0.9494815 0.9494815 0.9743487 0.9739303 0.9494815 0.9494815
 [15] 0.9743487 0.9743487 0.9743487 0.9743487 0.9743487 0.9743487 0.9743487
 [22] 0.9743487 0.9739303 0.9743487 0.9498999 0.9494815 0.9743487 0.9743487
 [29] 0.9743487 0.9494815 0.9494815 0.9743487 0.9743487 0.9743487 0.9494815
 [36] 0.9739303 0.9743487 0.9743487 0.9494815 0.9743487 0.9743487 0.9494815
 [43] 0.9494815 0.9743487 0.9743487 0.9494815 0.9743487 0.9494815 0.9743487
 [50] 0.9739303 0.5580841 0.8899172 0.8450199 0.8899172 0.8899172 0.8899172
 [57] 0.8899172 0.8664102 0.8899172 0.8899172 0.8743589 0.8899172 0.8899172
 [64] 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172
 [71] 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172
 [78] 0.8450199 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172
 [85] 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172 0.8899172
 [92] 0.8899172 0.8899172 0.8664102 0.8899172 0.8899172 0.8899172 0.8899172
 [99] 0.8664102 0.8899172 0.8450199 0.8899172 0.8450199 0.8450199 0.8450199
[106] 0.8450199 0.8899172 0.8450199 0.8450199 0.8450199 0.8450199 0.8450199
[113] 0.8450199 0.8899172 0.8899172 0.8450199 0.8450199 0.8450199 0.8450199
[120] 0.8899172 0.8450199 0.8899172 0.8450199 0.8899172 0.8450199 0.8450199
[127] 0.8899172 0.8899172 0.8450199 0.8450199 0.8450199 0.8450199 0.8450199
[134] 0.8899172 0.8450199 0.8450199 0.8450199 0.8450199 0.8899172 0.8450199
[141] 0.8450199 0.8450199 0.8899172 0.8450199 0.8450199 0.8450199 0.8899172
[148] 0.8450199 0.8450199 0.8899172

$ST_global_ch
[1] 0.9209621

$ST_global_sil
[1] 0.8676013

$ST_global_dunn
[1] 0.9225382

$ST_global_db
[1] 0.9009086

ClusterStability documentation built on May 30, 2017, 5:03 a.m.