kmodes {EnsCat}R Documentation

Run Kmodes

Description

This function runs Kmodes. The user must choose the number of clusters and the initial modes.

Usage

kmodes(data, k, k2)

Arguments

data

data should be a matrix or data frame, columns include the variables.

k

number of clusters

k2

set of initial modes; indices of data points

Details

This function clusters the rows of the data.

References

Huang, Z. (1998). Extensions to the v-means Algorithm for Clustering Large Data Sets with Categorical Values, Data Mining and Knowledge Discovery, 2, 283-304.

Examples

data("zoo")
### Run Kmodes on zoo data with 7 clusters and the first seventh observations as initial modes
kmodes(zoo$obs,k=7,1:7)
### Run Kmodes with seven random initial modes selected from data points
kmodes(zoo$obs,k=7,sort(sample(dim(zoo$obs)[1],7)))

[Package EnsCat version 1.1 Index]