【Machine Learning】K-means clustering algorithm and EM algorithm
1、The step of K-means clustering algorithm :
Step 1: Initialize cluster centroids randomly
Step 2: Repeat until convergence:{
For every i, set
For every j, set
}
Definition: are the training data set.
Analysis: K(a parameter of the algorithm)is the number of clusters.First, we get K cluster centorids, then, we iterate through each data point ,to find the closest cluster centroid , next, moving each cluster centroid to the mean of the points assigned to it. Repeat last two step until convergence.
K-means algorithm is used to find local optimal solution. The initialization can significantly affect the result of clustering.
2、EM(Exceptation-Maximization) algorithm