Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 673 Bytes

README.md

File metadata and controls

16 lines (14 loc) · 673 Bytes

K-means

A python implementation of k-means clustering algorithm.

Input

  1. A list of points in the plane where each point is represented by a latitude/longitude pair.
  2. The number of centroids
  3. The max_number of iterations
  4. The condition of convergence

Output

  • The final clusters of points.
  • An image to make the result clear.
  • Optional, the loss or clusters of points after each iteration

Technical details

The distance of two points in the code use the euclidean metric, you can also use other method as you like. You may have to modify the get_data code that data format in file may different, or you can modify the format of points just like me.