A python implementation of k-means clustering algorithm.
- A list of points in the plane where each point is represented by a latitude/longitude pair.
- The number of centroids
- The max_number of iterations
- The condition of convergence
- The final clusters of points.
- An image to make the result clear.
- Optional, the loss or clusters of points after each iteration
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.