stability: Estimate clustering stability of k-means

Description Usage Arguments Details Value Author(s) References Examples

View source: R/stability.R

Description

Estimate of k-means bootstrapping stability

Usage

1
stability(x, k, B = 20, r = 5, scheme_2 = TRUE)

Arguments

x

a data.frame of the data set

k

a integer number of clusters

B

number of bootstrap re-samplings

r

number of runs of k-means

scheme_2

logical TRUE if scheme 2 is used, FASLE if scheme 1 is used

Details

This function estimates the clustering stability through bootstrapping approach. Two schemes are provided. Scheme 1 uses the clustering of the original data as the reference for stability calculations. Scheme 2 searches acrossthe clustering samples that gives the most stable clustering.

Value

membership

a vector of membership for each observation from the reference clustering

obs_wise

vector of estimated observation-wise stability

overall

numeric estimated overall stability

Author(s)

Han Yu

References

Bootstrapping estimates of stability for clusters, observations and model selection. Han Yu, Brian Chapman, Arianna DiFlorio, Ellen Eischen, David Gotz, Matthews Jacob and Rachael Hageman Blair.

Examples

1
2
3
4
5
6
7
8
 ## Not run: 
set.seed(1)
data(wine)
x0 <- wine[,2:14]
x <- scale(x0)
stability(x, k = 3, B=20, r=5, scheme_2 = TRUE)

## End(Not run)

hyu-ub/bootcluster documentation built on May 20, 2021, 2:23 p.m.