kmeansW {FactoClass} | R Documentation |
It is a modification of kmeans Hartigan-Wong algorithm to consider the weight of the elements to classify.
kmeansW(x, centers, weight = rep(1/nrow(x),nrow(x)), iter.max = 10, nstart = 1)
x |
A numeric vector, matrix or data frame. |
centers |
Either the number of clusters or a set of initial (distinct) cluster centres. If a number, a random set of (distinct) rows in x is chosen as the initial centres. |
weight |
weight of the elements of x. by default the same. |
iter.max |
The maximum number of iterations allowed. |
nstart |
If centers is a number, how many random sets should be chosen? |
With the 'Hartigan-Wong' algorithm, this function performs the K-means clustering diminishing inertia intra classes.
object of class FactoClass.tex
with the following characteristics:
cluster |
vector indicating the cluster of each element. |
... |
Pedro Cesar del Campo pcdelcampon@unal.edu.co, Campo Elias Pardo cepardot@unal.edu.co, Mauricio Sadinle msadinleg@unal.edu.co http://www.docentes.unal.edu.co/cepardot
data(Bogota) ac.bog <- Bogota[-1] il.bog <- Bogota[ 1] acs <- dudi.coa( ac.bog, nf=6 , scannf = FALSE ) kmeansW( acs$li, 7, acs$lw )