This is an implementation of the K-Means clustering algorithm written in Python. The numpy library is also used to calculate how similar data points are to each other
To run this project clone this repository in a folder on your local machine. We first need to build our virtual environment and install a list of libraries our program needs to run. To do this, open a terminal in the root directory and run the following commands
make install // installs program dependencies
Next we need to activate our virual environment. To do this run the following commands
source venv/bin/activate // Activates our virtual environment
Now we can run our algorithm. Run these commands and you will see details of each cluster, centroids belonging those clusters, and the number of iterations the algorithm goes through before it converges
make runKMeans // runs the program
To exit the virtual environment run:
deactivate // runs the program
- Numpy
- use the matplotlib to plot the points on a graph and show the clusters at each iteration
- Add animations to move the clusters and update points
Made with ❤️ with Pycharm and vim