kmeansW {FactoClass}R Documentation

K-means with Weights of the Elements

Description

It is a modification of kmeans Hartigan-Wong algorithm to consider the weight of the elements to classify.

Usage

kmeansW(x, centers, weight = rep(1/nrow(x),nrow(x)),
        iter.max = 10, nstart = 1)

Arguments

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?

Details

With the 'Hartigan-Wong' algorithm, this function performs the K-means clustering diminishing inertia intra classes.

Value

object of class FactoClass.tex with the following characteristics:

cluster vector indicating the cluster of each element.
...

Author(s)

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

Examples

 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 )
 

[Package FactoClass version 0.7.6 Index]