Kmeans {Kmedians}R Documentation

Kmeans

Description

A K-means algorithm.

Usage

Kmeans(X,nclust=1:15,ninit=1,niter=20,par=TRUE)

Arguments

X

A numerical matrix giving the data.

nclust

A vector of positive integers giving the possible numbers of clusters. Default is 1:15.

ninit

A non negative integer giving the number of random initializations. Default is 1.

niter

A positive integer giving the number of iterations for the EM algorirthms. Default is 20.

par

A logical argument telling if the parallelization of the algorithm is allowed. Default is TRUE.

Value

A list with:

bestresults

A list giving all the results for the clustering selected by 'capushe'.

allresults

A list containing all the results.

SE

A vector giving the Sum of Errors for each considered number of clusters.

cap

The results given by the function 'capushe' if nclust is of length larger than 10.

Ksel

An integer giving the number of clusters selected by capushe if nclust is of length larger than 10.

data

A numerical matrix giving the data.

nclust

A vector of positive integers giving the considered numbers of clusters.

For the lists bestresult and allresults:

cluster

A vector of positive integers giving the clustering.

centers

A numerical matrix giving the centers of the clusteres.

SE

An integer giving the Sum of Errors.

See Also

See also Kmedians, Kplot and gen_K.

Examples

## Not run: 
n <- 500
K <- 3
pcont <- 0.2
ech <- gen_K(n=n,K=K,pcont=pcont)
X <-ech$X
res <- Kmeans(X,par=FALSE)
Kplot(res)

## End(Not run)

[Package Kmedians version 2.2.0 Index]