k-means algorithm

Runs the k-means algorithm on N random points on a given shape.
1,8K Descargas
Actualizado 5 mar 2010

Ver licencia

[counter] = kMeans(numPoints, numClusters, shape, drawOn, showOn)
This function takes as inputs: numPoints: the number of random points to cluster; numClusters: the number of clusters to group the points into; shape: a string 'square', 'circle', or 'tube' to carry out the kMeans process in; drawOn: a 1 or 0 indicating whether or not to show the points dynamically joining different clusters (not suitable for more than 500 points) ; showOn: a 1 or 0 indicating whether or not to show the update in clusters as a new figure after each iteration

Given the appropriate parameters kMeans first places k = numClusters random points in the given SHAPE and then carries out the kMeans algorithm. That is, we first assign each of the N = numPoints to the initial mean which is closest (in the standard Euclidean sense), then compute the centroid/center of mass of each cluster and then begin the reassignment process again.

Eventually, the algorithm will stabilize, and plots the final clusters as well as the path that the k means have followed.

Citar como

Tyler London (2026). k-means algorithm (https://la.mathworks.com/matlabcentral/fileexchange/26856-k-means-algorithm), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2009a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y MATLAB Answers.
Versión Publicado Notas de la versión
1.0.0.0