2014年2月26日 星期三

Calculation of K-mean Clustering

  1. Original K-means Clustering

    Suppose m1 is the mean of cluster 1 which has data points x1, x2, x3 and x4.
    Suppose mis the mean of cluster 2 which has data points x5, x6, x7, x8 and x9.



    There are some disadvantages of the original k-means clustering. First, it is possible that no data points assigned to the cluster with the initial mean in a bad initial guess. Second, the value of k(number of the data points) is not user-friendly because we don't know the number of clusters before we want to find clusters. Comparing to sequential k-means clustering, original k-means clustering is time-consuming. Try to imagine that if you want to add only one data point, how many data points you should have?  The answers is you need all the values of data points.
      
  2. Sequential K-means Clustering


    m1(left-hand side) = Updated mean of cluster 1
    m1(right-hand side) = Original mean of cluster 1
    n= Number of data points in cluster 1
    x = new data point


      
  3. Forgetful Sequential K-means Clustering


    mi(left-hand side) = Updated mean of cluster i
    mi(right-hand side) = Original mean of cluster i
    x= Number of data points in cluster i
    a = assigned weight, eg. 0.8



    Based on the above three calculations, you can get that the weight of x (i.e.data point) decreases exponentially with the "age" to the example. Moreover, a new formula can be derived from the above example.

    xj = the first j-th example in i
    mj = the mean vector of cluster i after the first j-th examples are added

沒有留言:

張貼留言