Main Content

k-Means andk-Medoids Clustering

Cluster by minimizing mean or medoid distance, and calculate Mahalanobis distance

k-meansandk-medoidsclusteringpartitions data intoknumber of mutually exclusive clusters. These techniques assign each observation to a cluster by minimizing the distance from the data point to the mean or median location of its assigned cluster, respectively.Mahalanobis distanceis a unitless metric computed using the mean and standard deviation of the sample data, and accounts for correlation within the data.

Live Editor Tasks

Cluster Data Cluster data usingk-means algorithm in the Live Editor

Functions

kmeans k-means clustering
kmedoids k-medoids clustering
mahal Mahalanobis distance to reference samples

Topics