clusterProjKmeans: K-means clustering on the projective space

Description Usage Arguments Value Author(s) See Also Examples

View source: R/cluster.R

Description

Creates K clusters of points on the projective space using the k-means method

Usage

1
clusterProjKmeans(X, K, iter.max = 100, initial)

Arguments

X

the data belonging to the projective space

K

the number of clusters required in output

iter.max

the maximum number of iterations

initial

(optional) the initial clustering. The argument 'initial' is required to be a vector of the same length as number of rows in X. Each element of 'initial' is the cluster number that the corresponding row of X belongs to. If 'initial' is specified, than 'K' is set to be the number of clusters in 'initial' If no initial is given, then the initial clusters are found using the k-means++ method.

Value

Vector of real numbers from 1 to K representing the cluster that the corresponding X value belongs to.

Author(s)

Jochen Voss, Jochen.Voss@leeds.ac.uk

See Also

clusterProjDivisive

Examples

1
2
3
4
5
6
n1 <- 37; n2 <- 19
x1 <- rnorm(n1, 6); y1 <- rnorm(n1, 0); z1 <- rnorm(n1, 0, 0.1)
x2 <- rnorm(n2, 8); y2 <- rnorm(n2, 8); z2 <- rnorm(n2, 0, 0.1)
X <- rbind(cbind(x1, y1, z1), cbind(x2, y2, z2)) * sample(c(-1, 1), size=n1+n2, replace=TRUE)
X <- X / sqrt(rowSums(X^2))
(c <- clusterProjKmeans(X, 2))

pws3141/goodICA documentation built on July 18, 2020, 5:58 p.m.