Skip to content

This is an implimention of the K-means clustering algorithm using python

Notifications You must be signed in to change notification settings

zmaqutu/machine-learning-k-means-clustering

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Learning K-Means clustering Algorithm

Table of Contents

Description

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

Project setup

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

Libraries Used

  • Numpy

Future Scope

  • 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