6) K-MEANS Algorithm

Source: Internet
Author: User
K-MEANS Algorithm:
The K-means algorithm accepts K input, and then divides n data objects into k clusters to meet the cluster requirements: the object similarity in the same cluster is high; the similarity between objects in different clusters is small. Clustering similarity is calculated by using the mean value of objects in each cluster to obtain a "central object" (gravity center.

The K-means algorithm is described as follows: First, K objects are randomly selected as the initial cluster center from n data objects, then, based on their similarity (distance) with these Clustering Centers, they are allocated to the most similar (represented by the clustering Center) Clustering respectively; then calculate the clustering center of each new cluster (the mean of all objects in the cluster). repeat this process until the standard measure function starts to converge. Generally, the mean variance is used as the standard measure function. k clusters have the following characteristics: each cluster itself is as compact as possible, and each cluster is separated as much as possible.

The details are as follows:
Input: K, data [N];
(1) Select K initial centers, for example, C [0] = data [0],… C [k-1] = data [k-1];
(2) For data [0]... Data [N], respectively, with C [0]… C [n-1], if the difference with C [I] is the least, it is marked as I;
(3) For all data marked as I points, recalculate C [I] = {the sum of all data [J] marked as I}/The number of data marked as I;
(4) Repeat (2) (3) until all C [I] values change less than the given threshold.

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.