KMwrapper: Wrapper to do K-means clustering

Description Usage Arguments Value See Also Examples

View source: R/KMwrapper.R

Description

Standard K-means clustering. The wrapper performs multiple restarts in case true labels are provided (in order to optimise cluster assignments w.r.t. the Rand index).

Usage

1
KMwrapper(xx, k, true_labels = NULL, verbose = FALSE)

Arguments

xx

The data matrix (n x p).

k

The number of clusters.

true_labels

Vector of true cluster assignments (when provided, it is used to compute the Rand index).

verbose

Logical, when true: print progress information.

Value

model_fit

Model fit (output of kmeans).

aRI

Adjusted Rand index (when true_labels is provided).

See Also

kmeans, adjustedRandIndex

Examples

1
  KMwrapper(xx = matrix(rnorm(500),50,10), k = 2)

btaschler/mcap documentation built on May 26, 2019, 1:31 a.m.