This project is the implementation of K-means clustering algorithm for unsupervised machine learning.
Task from Machine Learning for Greenhorns – Winter 2020/21. Part of this code was provided by Milan Straka.
The algorithm is implemented in k_means.py. The main method is
k_means.
The file k_means_main.py shows how to use the implemented algorithm on some artificial data.
The example of the invocation of the program is:
python k_means_main.py --clusters=7 --examples=200 --iterations=5 --seed=67 --init=kmeans++ --plot=plot
clustersspecifies the number of clusters to generateexamplesspecifies the amount of data points to be generatediterationsis the number of iterations of the K-means algorithmseedspecifies the random seedinitspecifies the initialization of the cluster centers, can berandomorkmeans++plotis the name of output file of the plot
The result of the previous invocation is the following output file:
