Skip to content

Implementation of K-means algorithm for clustering in Python

Notifications You must be signed in to change notification settings

jaras209/K_means

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

K-means

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.

k_means

The algorithm is implemented in k_means.py. The main method is k_means.

k_means_main

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

  • clusters specifies the number of clusters to generate
  • examples specifies the amount of data points to be generated
  • iterations is the number of iterations of the K-means algorithm
  • seed specifies the random seed
  • init specifies the initialization of the cluster centers, can be random or kmeans++
  • plot is the name of output file of the plot

The result of the previous invocation is the following output file: plot

About

Implementation of K-means algorithm for clustering in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages