One, unsupervised learning
1. Clustering: It is a process of classifying and organizing data members with similar data concentrations in some aspects. Therefore, a cluster is a collection of some data instances. Clustering techniques are often called unsupervised learning.
Second, K-means clustering
1, K-means algorithm: is the discovery of a given dataset K cluster algorithm
2. Steps:
1), randomly selected K number of points as the initial cluster center (requires the discovery of K-clusters).
2), assign each data point to its nearest cluster center (the distance from all points in the graph to the K seed point, if the point P is nearest to the seed point S, then p belongs to the S-point group. )
3), re-determine the cluster center (x, y), once all the data points are allocated, each cluster center of clustering will be more existing data points recalculated. x = (X1+X2+......XN)/n,y = (Y1+y2+......yn)/n.
4), 2) 3) The process repeats, knowing that three termination (convergence) conditions are met:
A, to meet the number of repetitions, such as the request loop execution 50 times, the 51st stop.
b, no cluster center is changed again.
C, error and (SSE) local minimum.
3, pseudo-code:
1Algorithm Kmeans (k,d)2Choose K data Points asThe initial centroids (cluster centers)3 Repeat4 forEach data point X->d Do5Compute the distance fromx to each centroid;6 assign x to the closest centroid7 endfor8Re-computer the centroidusingThe current cluster memberships9Until the stopping criterion
K-Means algorithm (data mining unsupervised learning)