SEARCH FOR CLUSTERS: the $K$-MEANS algorithm


Objective

  • min. distance between objects in a cluster
  • max. distance between clusters
  • Algorithm

    1. Create $k$ initial clusters and find their centers
    2. For a random object, $x$, in cluster $C$:
      1. find the distance, $d$, from the center of $C$
      2. find the distances, $d_i$, from the centers of all other clusters
    3. Find the closest cluster, $C$.
    4. If $C$ $\neq$ $C\prime$, move $x$ from $C$ to $C\prime$ and recalculate the centers
    5. Go to 2 (repeat until no object moves)

    Settings

    Level of randomness of points
    : 0%
    100%
    Number of points
    :
    Number of real clusters
    :
    Number of finding clusters (centroids)
    :

    You can drag initial centroids if you want to change them!!!

    New points New centroids Find closest clusters (Step 3)
    Mean square of point-centroid distance : not yet calculated