best_kmeans(X)

Version 1.1.0.0 (1.62 KB) by Feng Bao
This function can determine the best cluster numbers in clustering using k-means method.
2.9K Downloads
Updated 13 Apr 2015

View License

[IDX,C,SUMD,K] = best_kmeans(X) partitions the points in the N-by-P data matrix X
into K clusters. Rows of X correspond to points, columns correspond to variables.
IDX containing the cluster indices of each point.
C is the K cluster centroids locations in the K-by-P matrix C.
SUMD are sums of point-to-centroid distances in the 1-by-K vector.
K is the number of cluster centriods determined using ELBOW method.
ELBOW method: computing the destortions under different cluster number counting from
1 to n, and K is the cluster number corresponding 90% percentage of
variance expained, which is the ratio of the between-group variance to
the total variance. see <http://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set>
After find the best K clusters, IDX,C,SUMD are determined using kmeans
function in matlab.

Cite As

Feng Bao (2026). best_kmeans(X) (https://in.mathworks.com/matlabcentral/fileexchange/49489-best_kmeans-x), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

update description

1.0.0.0