A simple python code that implements the K-Means algorithm
kmeans.py
- is the main file containing all the logic for k-means algorithm
-
- input file that contains a list of co-ordinates like
co-ordinate1,co-ordinate2
each point should be in a new line and each axis value is separated with a comma
- input file that contains a list of co-ordinates like
-
-h
For help menu-i
The number of iterations you want to run the algorithm-c
The number of centroids you want to try with-f
The input file that contains the coordinate
-
Once all the requirements are satisfied you can run the code using
python3 kmeans.py [args]