k_modes: K-modes

View source: R/consensus_funs.R

k_modesR Documentation

K-modes

Description

Combine clustering results using K-modes.

Usage

k_modes(E, is.relabelled = TRUE, seed = 1)

Arguments

E

a matrix of clusterings with number of rows equal to the number of cases to be clustered, number of columns equal to the clustering obtained by different resampling of the data, and the third dimension are the different algorithms. Matrix may already be two-dimensional.

is.relabelled

logical; if FALSE the data will be relabelled using the first clustering as the reference.

seed

random seed for reproducibility

Details

Combine clustering results generated using different algorithms and different data perturbations by k-modes. This method is the categorical data analog of k-means clustering. Complete cases are needed: i.e. no NAs. If the matrix contains NAs those are imputed by majority voting (after class relabeling).

Value

a vector of cluster assignments based on k-modes

Author(s)

Aline Talhouk

References

Luo, H., Kong, F., & Li, Y. (2006, August). Combining multiple clusterings via k-modes algorithm. In International Conference on Advanced Data Mining and Applications (pp. 308-315). Springer, Berlin, Heidelberg.

See Also

Other consensus functions: CSPA(), LCA(), LCE(), majority_voting()

Examples

data(hgsc)
dat <- hgsc[1:100, 1:50]
cc <- consensus_cluster(dat, nk = 4, reps = 6, algorithms = "pam", progress =
FALSE)
table(k_modes(cc[, , 1, 1, drop = FALSE], is.relabelled = FALSE))

AlineTalhouk/diceR documentation built on Jan. 28, 2024, 4:06 p.m.