This repository contains an example of using K-means clustering to partition data into distinct groups based on similarity.
K-means clustering is a popular unsupervised machine learning algorithm used for clustering data points into a predefined number of clusters. It is widely used for various applications such as customer segmentation, image compression, and anomaly detection.
In this example, we use the Scikit-learn library in Python to perform K-means clustering on a synthetic dataset. We visualize the clusters and centroids to understand how the algorithm groups data points based on their features.
To run the code in this repository, you need the following Python libraries:
- numpy
- matplotlib
- scikit-learn
The script will generate a plot displaying the clusters identified by K-means clustering and their centroids. Adjustments to the number of clusters and dataset parameters can be made within the script to explore different scenarios.
This project is licensed under the MIT License - see the LICENSE file for details.
- The example dataset used in this repository is generated using scikit-learn's
make_blobs
function. - Inspiration and initial setup may have been derived from various online resources and documentation.