This repository provides a simple implementation of the K-Means clustering algorithm in Python. The goal of this implementation is to provide an easy-to-understand and easy-to-use version of the algorithm, suitable for small datasets.
- Implementation of the K-Means clustering algorithm
- Example code that demonstrates how to use the algorithm on a toy dataset
- Plots of the clustered data and centroids for visualization
- A simple script for testing the algorithm on custom datasets
- kmeans.py: The main implementation of the K-Means algorithm
- example.py: Example code that demonstrates how to use the algorithm on a toy dataset
- test.py: A simple script for testing the algorithm on custom datasets
Clone the repository using
git clone https://github.com/username/kmeans-clustering-python.git
Install the required dependencies using
pip install -r requirements.txt
Run the example code using
python example.py
Customize the code in 'test.py' to use the algorithm on your own datasets.