- -f : input filename
- -k : number of clusters
- -i : max iterations
- -o : output filename
execution example:
python kmeans.py -k 3 -f 'datasets/data.dat'
the result of executing the commandline is shown below.
The red dots represent each centroid calculated in each iteration of the algorithm, while every other color represents one of the k classes.
the code in gifGenerator.py takes a snapshot of the data in each of the iterations of the k-means process.the gifGenerator.py file can receive some arguments as described below.
- -f : input filename
- -k : number of clusters
- -i : max iterations
- -o : output filename
- -s : gif frames per second
execution example:
python gifGenerator.py -k 6 -s 1 -f datasets/data2.dat
the .gif output produced after running this command line can be seen below.

