Last data update: 2014.03.03
R: Calculates the exact stability score (_ST_) for individual...
ClusterStability_exact R Documentation
Calculates the exact stability score (ST ) for individual objects in a clustering solution.
Description
This function will return the exact individual stability score ST and the exact global score STglobal using either the K-means or K-medoids algorithm and four different clustering indices: Calinski-Harabasz, Silhouette, Dunn or Davies-Bouldin. Variable overflow errors are possible for large numbers of objects .
Usage
ClusterStability_exact(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 exact 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
## Calculate the stability scores of individual objects of the Iris dataset
## using K-means, 100 replicates (random starts) and k=3
ClusterStability_exact(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_exact.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ClusterStability_exact
> ### Title: Calculates the exact stability score (_ST_) for individual
> ### objects in a clustering solution.
> ### Aliases: ClusterStability_exact
> ### Keywords: Stability score,ST,individual,global,exact
>
> ### ** Examples
>
> ## Calculate the stability scores of individual objects of the Iris dataset
> ## using K-means, 100 replicates (random starts) and k=3
> ClusterStability_exact(dat=iris[1:4],k=3,replicate=100,type='kmeans');
$ST_ch
[1] 0.9759461 0.9510162 0.9510162 0.9510162 0.9759461 0.9749661 0.9523580
[8] 0.9759461 0.9510162 0.9510162 0.9749661 0.9757278 0.9510162 0.9510162
[15] 0.9749661 0.9749661 0.9749661 0.9759461 0.9749661 0.9749661 0.9749661
[22] 0.9749661 0.9757278 0.9749661 0.9512346 0.9510162 0.9759461 0.9749661
[29] 0.9759461 0.9510162 0.9510162 0.9749661 0.9749661 0.9749661 0.9510162
[36] 0.9757278 0.9749661 0.9759461 0.9510162 0.9759461 0.9759461 0.9510162
[43] 0.9510162 0.9749661 0.9749661 0.9510162 0.9749661 0.9510162 0.9749661
[50] 0.9757278 0.5699994 0.8935429 0.8489040 0.8935429 0.8935429 0.8935429
[57] 0.8935429 0.8728710 0.8935429 0.8935429 0.8780003 0.8935429 0.8935429
[64] 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429
[71] 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429
[78] 0.8489040 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429
[85] 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429 0.8935429
[92] 0.8935429 0.8935429 0.8728710 0.8935429 0.8935429 0.8935429 0.8935429
[99] 0.8728710 0.8935429 0.8489040 0.8935429 0.8489040 0.8489040 0.8489040
[106] 0.8489040 0.8935429 0.8489040 0.8489040 0.8489040 0.8489040 0.8489040
[113] 0.8489040 0.8935429 0.8935429 0.8489040 0.8489040 0.8489040 0.8489040
[120] 0.8935429 0.8489040 0.8935429 0.8489040 0.8935429 0.8489040 0.8489040
[127] 0.8935429 0.8935429 0.8489040 0.8489040 0.8489040 0.8489040 0.8489040
[134] 0.8935429 0.8489040 0.8489040 0.8489040 0.8489040 0.8935429 0.8489040
[141] 0.8489040 0.8489040 0.8935429 0.8489040 0.8489040 0.8489040 0.8935429
[148] 0.8489040 0.8489040 0.8935429
$ST_sil
[1] 0.9590491 0.9165390 0.9165390 0.9165390 0.9590491 0.9573848 0.9188219
[8] 0.9590491 0.9165390 0.9165390 0.9573848 0.9586814 0.9165390 0.9165390
[15] 0.9573848 0.9573848 0.9573848 0.9590491 0.9573848 0.9573848 0.9573848
[22] 0.9573848 0.9586814 0.9573848 0.9169068 0.9165390 0.9590491 0.9573848
[29] 0.9590491 0.9165390 0.9165390 0.9573848 0.9573848 0.9573848 0.9165390
[36] 0.9586814 0.9573848 0.9590491 0.9165390 0.9590491 0.9590491 0.9165390
[43] 0.9165390 0.9573848 0.9573848 0.9165390 0.9573848 0.9165390 0.9573848
[50] 0.9586814 0.6105836 0.8219671 0.7463883 0.8219671 0.8219671 0.8219671
[57] 0.8219671 0.7868088 0.8219671 0.8219671 0.7954605 0.8219671 0.8219671
[64] 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671
[71] 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671
[78] 0.7463883 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671
[85] 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671 0.8219671
[92] 0.8219671 0.8219671 0.7868088 0.8219671 0.8219671 0.8219671 0.8219671
[99] 0.7868088 0.8219671 0.7463883 0.8219671 0.7463883 0.7463883 0.7463883
[106] 0.7463883 0.8219671 0.7463883 0.7463883 0.7463883 0.7463883 0.7463883
[113] 0.7463883 0.8219671 0.8219671 0.7463883 0.7463883 0.7463883 0.7463883
[120] 0.8219671 0.7463883 0.8219671 0.7463883 0.8219671 0.7463883 0.7463883
[127] 0.8219671 0.8219671 0.7463883 0.7463883 0.7463883 0.7463883 0.7463883
[134] 0.8219671 0.7463883 0.7463883 0.7463883 0.7463883 0.8219671 0.7463883
[141] 0.7463883 0.7463883 0.8219671 0.7463883 0.7463883 0.7463883 0.8219671
[148] 0.7463883 0.7463883 0.8219671
$ST_dunn
[1] 0.9765019 0.9503852 0.9503852 0.9503852 0.9765019 0.9759121 0.9517962
[8] 0.9765019 0.9503852 0.9503852 0.9759121 0.9763708 0.9503852 0.9503852
[15] 0.9759121 0.9759121 0.9759121 0.9765019 0.9759121 0.9759121 0.9759121
[22] 0.9759121 0.9763708 0.9759121 0.9505163 0.9503852 0.9765019 0.9759121
[29] 0.9765019 0.9503852 0.9503852 0.9759121 0.9759121 0.9759121 0.9503852
[36] 0.9763708 0.9759121 0.9765019 0.9503852 0.9765019 0.9765019 0.9503852
[43] 0.9503852 0.9759121 0.9759121 0.9503852 0.9759121 0.9503852 0.9759121
[50] 0.9763708 0.5644705 0.8938661 0.8501292 0.8938661 0.8938661 0.8938661
[57] 0.8938661 0.8744419 0.8938661 0.8938661 0.8775222 0.8938661 0.8938661
[64] 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661
[71] 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661
[78] 0.8501292 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661
[85] 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661 0.8938661
[92] 0.8938661 0.8938661 0.8744419 0.8938661 0.8938661 0.8938661 0.8938661
[99] 0.8744419 0.8938661 0.8501292 0.8938661 0.8501292 0.8501292 0.8501292
[106] 0.8501292 0.8938661 0.8501292 0.8501292 0.8501292 0.8501292 0.8501292
[113] 0.8501292 0.8938661 0.8938661 0.8501292 0.8501292 0.8501292 0.8501292
[120] 0.8938661 0.8501292 0.8938661 0.8501292 0.8938661 0.8501292 0.8501292
[127] 0.8938661 0.8938661 0.8501292 0.8501292 0.8501292 0.8501292 0.8501292
[134] 0.8938661 0.8501292 0.8501292 0.8501292 0.8501292 0.8938661 0.8501292
[141] 0.8501292 0.8501292 0.8938661 0.8501292 0.8501292 0.8501292 0.8938661
[148] 0.8501292 0.8501292 0.8938661
$ST_db
[1] 0.9694151 0.9378495 0.9378495 0.9378495 0.9694151 0.9681405 0.9395665
[8] 0.9694151 0.9378495 0.9378495 0.9681405 0.9691311 0.9378495 0.9378495
[15] 0.9681405 0.9681405 0.9681405 0.9694151 0.9681405 0.9681405 0.9681405
[22] 0.9681405 0.9691311 0.9681405 0.9381335 0.9378495 0.9694151 0.9681405
[29] 0.9694151 0.9378495 0.9378495 0.9681405 0.9681405 0.9681405 0.9378495
[36] 0.9691311 0.9681405 0.9694151 0.9378495 0.9694151 0.9694151 0.9378495
[43] 0.9378495 0.9681405 0.9681405 0.9378495 0.9681405 0.9378495 0.9681405
[50] 0.9691311 0.5821592 0.8658954 0.8096491 0.8658954 0.8658954 0.8658954
[57] 0.8658954 0.8395523 0.8658954 0.8658954 0.8462230 0.8658954 0.8658954
[64] 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954
[71] 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954
[78] 0.8096491 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954
[85] 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954 0.8658954
[92] 0.8658954 0.8658954 0.8395523 0.8658954 0.8658954 0.8658954 0.8658954
[99] 0.8395523 0.8658954 0.8096491 0.8658954 0.8096491 0.8096491 0.8096491
[106] 0.8096491 0.8658954 0.8096491 0.8096491 0.8096491 0.8096491 0.8096491
[113] 0.8096491 0.8658954 0.8658954 0.8096491 0.8096491 0.8096491 0.8096491
[120] 0.8658954 0.8096491 0.8658954 0.8096491 0.8658954 0.8096491 0.8096491
[127] 0.8658954 0.8658954 0.8096491 0.8096491 0.8096491 0.8096491 0.8096491
[134] 0.8658954 0.8096491 0.8096491 0.8096491 0.8096491 0.8658954 0.8096491
[141] 0.8096491 0.8096491 0.8658954 0.8096491 0.8096491 0.8096491 0.8658954
[148] 0.8096491 0.8096491 0.8658954
$ST_global_ch
[1] 0.903917
$ST_global_sil
[1] 0.8409212
$ST_global_dunn
[1] 0.904436
$ST_global_db
[1] 0.8796598
>
>
>
>
>
> dev.off()
null device
1
>