K-Means algorithm (data mining unsupervised learning)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.