Last data update: 2014.03.03

R: Calculates the approximate stability score (_ST_) of...
ClusterStabilityR Documentation

Calculates the approximate stability score (ST) of individual objects in a clustering solution (the approximate version allowing one to avoid possible variable overflow errors).

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

ClusterStability(dat, k, replicate, type) 

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

   ## 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');

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ClusterStability)
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 1.8-12 (Built: 2016-07-02)
Website: http://traminer.unige.ch
Please type 'citation("TraMineR")' for citation information.

This is WeightedCluster stable version 1.2 (Built: 2016-07-02)

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
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ClusterStability/ClusterStability.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ClusterStability
> ### Title: Calculates the approximate stability score (_ST_) of individual
> ###   objects in a clustering solution (the approximate version allowing
> ###   one to avoid possible variable overflow errors).
> ### Aliases: ClusterStability
> ### Keywords: Stability score,ST,individual,global,approximative
> 
> ### ** Examples
> 
>    ## 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');
$ST_ch
  [1] 0.9887494 0.9746599 0.9746599 0.9746599 0.9887494 0.9887494 0.9771834
  [8] 0.9887494 0.9746599 0.9746599 0.9887494 0.9887494 0.9746599 0.9746599
 [15] 0.9887494 0.9887494 0.9887494 0.9887494 0.9887494 0.9887494 0.9887494
 [22] 0.9887494 0.9887494 0.9887494 0.9746599 0.9746599 0.9887494 0.9887494
 [29] 0.9887494 0.9746599 0.9746599 0.9887494 0.9887494 0.9887494 0.9746599
 [36] 0.9887494 0.9887494 0.9887494 0.9746599 0.9887494 0.9887494 0.9746599
 [43] 0.9746599 0.9887494 0.9887494 0.9746599 0.9887494 0.9746599 0.9887494
 [50] 0.9887494 0.5239130 0.9444198 0.9238216 0.9444198 0.9444198 0.9444198
 [57] 0.9444198 0.9357979 0.9444198 0.9444198 0.9357979 0.9444198 0.9444198
 [64] 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198
 [71] 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198
 [78] 0.9238216 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198
 [85] 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198 0.9444198
 [92] 0.9444198 0.9444198 0.9357979 0.9444198 0.9444198 0.9444198 0.9444198
 [99] 0.9357979 0.9444198 0.9238216 0.9444198 0.9238216 0.9238216 0.9238216
[106] 0.9238216 0.9444198 0.9238216 0.9238216 0.9238216 0.9238216 0.9238216
[113] 0.9238216 0.9444198 0.9444198 0.9238216 0.9238216 0.9238216 0.9238216
[120] 0.9444198 0.9238216 0.9444198 0.9238216 0.9444198 0.9238216 0.9238216
[127] 0.9444198 0.9444198 0.9238216 0.9238216 0.9238216 0.9238216 0.9238216
[134] 0.9444198 0.9238216 0.9238216 0.9238216 0.9238216 0.9444198 0.9238216
[141] 0.9238216 0.9238216 0.9444198 0.9238216 0.9238216 0.9238216 0.9444198
[148] 0.9238216 0.9238216 0.9444198

$ST_sil
  [1] 0.9797538 0.9544001 0.9544001 0.9544001 0.9797538 0.9797538 0.9589317
  [8] 0.9797538 0.9544001 0.9544001 0.9797538 0.9797538 0.9544001 0.9544001
 [15] 0.9797538 0.9797538 0.9797538 0.9797538 0.9797538 0.9797538 0.9797538
 [22] 0.9797538 0.9797538 0.9797538 0.9544001 0.9544001 0.9797538 0.9797538
 [29] 0.9797538 0.9544001 0.9544001 0.9797538 0.9797538 0.9797538 0.9544001
 [36] 0.9797538 0.9797538 0.9797538 0.9544001 0.9797538 0.9797538 0.9544001
 [43] 0.9544001 0.9797538 0.9797538 0.9544001 0.9797538 0.9544001 0.9797538
 [50] 0.9797538 0.5475365 0.9043490 0.8665425 0.9043490 0.9043490 0.9043490
 [57] 0.9043490 0.8888328 0.9043490 0.9043490 0.8888328 0.9043490 0.9043490
 [64] 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490
 [71] 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490
 [78] 0.8665425 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490
 [85] 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490 0.9043490
 [92] 0.9043490 0.9043490 0.8888328 0.9043490 0.9043490 0.9043490 0.9043490
 [99] 0.8888328 0.9043490 0.8665425 0.9043490 0.8665425 0.8665425 0.8665425
[106] 0.8665425 0.9043490 0.8665425 0.8665425 0.8665425 0.8665425 0.8665425
[113] 0.8665425 0.9043490 0.9043490 0.8665425 0.8665425 0.8665425 0.8665425
[120] 0.9043490 0.8665425 0.9043490 0.8665425 0.9043490 0.8665425 0.8665425
[127] 0.9043490 0.9043490 0.8665425 0.8665425 0.8665425 0.8665425 0.8665425
[134] 0.9043490 0.8665425 0.8665425 0.8665425 0.8665425 0.9043490 0.8665425
[141] 0.8665425 0.8665425 0.9043490 0.8665425 0.8665425 0.8665425 0.9043490
[148] 0.8665425 0.8665425 0.9043490

$ST_dunn
  [1] 0.9883046 0.9736581 0.9736581 0.9736581 0.9883046 0.9883046 0.9762814
  [8] 0.9883046 0.9736581 0.9736581 0.9883046 0.9883046 0.9736581 0.9736581
 [15] 0.9883046 0.9883046 0.9883046 0.9883046 0.9883046 0.9883046 0.9883046
 [22] 0.9883046 0.9883046 0.9883046 0.9736581 0.9736581 0.9883046 0.9883046
 [29] 0.9883046 0.9736581 0.9736581 0.9883046 0.9883046 0.9883046 0.9736581
 [36] 0.9883046 0.9883046 0.9883046 0.9736581 0.9883046 0.9883046 0.9736581
 [43] 0.9736581 0.9883046 0.9883046 0.9736581 0.9883046 0.9736581 0.9883046
 [50] 0.9883046 0.5196569 0.9422027 0.9212252 0.9422027 0.9422027 0.9422027
 [57] 0.9422027 0.9332399 0.9422027 0.9422027 0.9332399 0.9422027 0.9422027
 [64] 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027
 [71] 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027
 [78] 0.9212252 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027
 [85] 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027 0.9422027
 [92] 0.9422027 0.9422027 0.9332399 0.9422027 0.9422027 0.9422027 0.9422027
 [99] 0.9332399 0.9422027 0.9212252 0.9422027 0.9212252 0.9212252 0.9212252
[106] 0.9212252 0.9422027 0.9212252 0.9212252 0.9212252 0.9212252 0.9212252
[113] 0.9212252 0.9422027 0.9422027 0.9212252 0.9212252 0.9212252 0.9212252
[120] 0.9422027 0.9212252 0.9422027 0.9212252 0.9422027 0.9212252 0.9212252
[127] 0.9422027 0.9422027 0.9212252 0.9212252 0.9212252 0.9212252 0.9212252
[134] 0.9422027 0.9212252 0.9212252 0.9212252 0.9212252 0.9422027 0.9212252
[141] 0.9212252 0.9212252 0.9422027 0.9212252 0.9212252 0.9212252 0.9422027
[148] 0.9212252 0.9212252 0.9422027

$ST_db
  [1] 0.9855183 0.9673780 0.9673780 0.9673780 0.9855183 0.9855183 0.9706577
  [8] 0.9855183 0.9673780 0.9673780 0.9855183 0.9855183 0.9673780 0.9673780
 [15] 0.9855183 0.9855183 0.9855183 0.9855183 0.9855183 0.9855183 0.9855183
 [22] 0.9855183 0.9855183 0.9855183 0.9673780 0.9673780 0.9855183 0.9855183
 [29] 0.9855183 0.9673780 0.9673780 0.9855183 0.9855183 0.9855183 0.9673780
 [36] 0.9855183 0.9855183 0.9855183 0.9673780 0.9855183 0.9855183 0.9673780
 [43] 0.9673780 0.9855183 0.9855183 0.9673780 0.9855183 0.9673780 0.9855183
 [50] 0.9855183 0.5286633 0.9298577 0.9034007 0.9298577 0.9298577 0.9298577
 [57] 0.9298577 0.9187611 0.9298577 0.9298577 0.9187611 0.9298577 0.9298577
 [64] 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577
 [71] 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577
 [78] 0.9034007 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577
 [85] 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577 0.9298577
 [92] 0.9298577 0.9298577 0.9187611 0.9298577 0.9298577 0.9298577 0.9298577
 [99] 0.9187611 0.9298577 0.9034007 0.9298577 0.9034007 0.9034007 0.9034007
[106] 0.9034007 0.9298577 0.9034007 0.9034007 0.9034007 0.9034007 0.9034007
[113] 0.9034007 0.9298577 0.9298577 0.9034007 0.9034007 0.9034007 0.9034007
[120] 0.9298577 0.9034007 0.9298577 0.9034007 0.9298577 0.9034007 0.9034007
[127] 0.9298577 0.9298577 0.9034007 0.9034007 0.9034007 0.9034007 0.9034007
[134] 0.9298577 0.9034007 0.9034007 0.9034007 0.9034007 0.9298577 0.9034007
[141] 0.9034007 0.9034007 0.9298577 0.9034007 0.9034007 0.9034007 0.9298577
[148] 0.9034007 0.9034007 0.9298577

$ST_global_ch
[1] 0.9492709

$ST_global_sil
[1] 0.9141015

$ST_global_dunn
[1] 0.9474596

$ST_global_db
[1] 0.9365833

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>