K-means:optimization objective (Minimize cost function to find the corresponding parameter)

Source: Internet
Author: User

Similar to the linear Regression,k-means algorithm optimization objective or an attempt to minimize the cost function.

Understanding the optimization of the K-means algorithm objective help us (1) debug the algorithm to see if the algorithm is running correctly (as you can see in this section)(2) to make the algorithm find a better cluster, Avoid local optimal solutions (as explained in the next section)

K-means Optimization Objective

UC (i): The cluster of the cluster that represents X (i) centroid

K indicates that there are K cluster,k that represent the index of the cluster centoid.

Cost function is x (i) to the sum of the squares of the distance of the cluster centroid belonging to its cluster

The parameter C and u are obtained by calculating the minimum value of the cost function.

This cost function is sometimes referred to as the distortion costs function

K-means algorithm

Wrt:with respect to (about)

Cluster Assignment Step: The C value when you fix the U and C as the parameter to find the minimum value of function J (c)

Move centroid Step: c fixed, u as parameter to find the minimum value of the cost function J (U)

The final C and U are obtained by means of loop convergence.

So we can see if the program is working correctly by the relationship between the number of iterations and the function of the cost function. The correct running program should be as the number of iterations increases, the cost function decreases and converges

Summarize

    1. The process of K-means algorithm is to minimize cost function J to find optimal parameters.
    2. Determine if the algorithm is running correctly by convergence with the cost function as the number of iterations increases

K-means:optimization objective (Minimize cost function to find the corresponding parameter)

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.