kmodes function

Run Kmodes

Run Kmodes

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

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") ## on zoo data with 7 clusters and the first seventh observations as initial modes kmodes(zoo$obs,k=7,1:7) ## with seven random initial modes selected from data points kmodes(zoo$obs,k=7,sort(sample(dim(zoo$obs)[1],7)))
  • Maintainer: Saeid Amiri
  • License: GPL (>= 2)
  • Last published: 2017-02-01

Useful links