k-means Algorithm Implementation with MATLAB Code
The k-means algorithm accepts parameter k as input and partitions n data objects into k clusters, ensuring high similarity within clusters and low similarity between clusters. Cluster similarity is calculated using centroid objects (gravity centers) obtained from the mean values of objects in each cluster. This MATLAB implementation uses the Iris dataset for testing and demonstrates centroid calculation, iterative assignment, and convergence mechanisms.