K-Means is a popular clustering algorithm with fast running speed and high scalability. Moreover, this algorithm could be easily implemented using the Matlab built in function “pdist2" ( for details please refer to http://www.mathworks.com/help/stats/pdist2.html)
[clusterCenters, clusterBelonging] = k_means(data, k, startingPoints)
data: points to be clustered K: # of clusters startPoints:the starting centroids of the k clusters. If not given explicitly, one common approach is to randomly select k points from input dataset clusterCenter: the centers of the clusters after running K-Means clusterBelonging: the cluster each data point belongs to
[clusterCenters, clusterBelonging] = k_means(data, k, startingPoints)
data: points to be clustered
K: # of clusters
startPoints:the starting centroids of the k clusters. If not given explicitly, one common approach is to randomly select k points from input dataset
clusterCenter: the centers of the clusters after running K-Means
clusterBelonging: the cluster each data point belongs to
|
Monday, October 5, 2015
Implement K-Means Clustering with Matlab
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment