Learn R Programming

CompositionalClust (version 1.2)

cikmeans: The \(K\)--means algorithm with cluster indices computed

Description

The \(K\)--means algorithm with cluster indices computed.

Usage

cikmeans(y, ncl = 10, trim = 0, max.iters = 50, nstart = 10, all = FALSE)

Value

A list inclusing:

min_crit

A matrix with 9 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl.

best_min

The number of clusters selected based upon the minimal valued cluster validity indices.

max_crit

A matrix with 24 columns and at least one row, where each column contains the value of a cluster validity index, whose minimal vlaue is preferred. Each row corresponds to a specific number of clusters, starting from 2 up to ncl.

best_max

The number of clusters selected based upon the maximal valued cluster validity indices.

cluster

If the argument "all" is TRUE, then the clustering indices of each observation for each number of clusters will be returned in a matrix, where each column corresponds to the clustering of each number of clusters.

Arguments

y

A matrix with numerical data.

ncl

The maximum number of clusters to try. The minimum number of clusters is 2.

trim

A number in [0, 1). If trim = 0, then the classical \(K\)--means algorithm is performed. If you chose a number higher than 0 then the trimmed \(K\)--means of Garcia-Escudero et al. (2008) is performed.

max.iters

The maximum number of iterations allowed during the \(K\)--means algortihm.

nstart

How many random starts to perform?

all

If this is TRUE, then the clustering indices of each observation for each number of clusters will be returned.

Author

Michail Tsagris and Nikolaos Kontemeniotis.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Nikolaos Kontemeniotis kontemeniotisn@gmail.com. .

Details

The \(K\)--means algorithm is performed and a series of cluster validity indices are computed.

References

Garcia-Escudero Luis A., Gordaliza Alfonso, Matran Carlos, Mayo-Iscar Agustin. (2008). A general trimming approach to robust cluster analysis. Annals of Statistics 36(3): 1324--1345.

See Also

index_min, index_max, alfa.cikmeans

Examples

Run this code
y <- as.matrix(iris[, 1:4])
y <- y / rowSums(y)
mod <- cikmeans(y, ncl = 5)

Run the code above in your browser using DataLab