Saved searches
Use saved searches to filter your results more quickly
Cancel Create saved search
Sign up Reseting focus
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
License
Notifications You must be signed in to change notification settings
yashmaniya0/K-Means-Clustering-Simulator
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go to file
Folders and files
Last commit message
Last commit date
Latest commit
History
View all files
Repository files navigation
K-Means Clustering Simulator App
This is a Dash web application for simulating and visualizing the K-Means clustering algorithm.
Github Link
Introduction
The K-Means algorithm is an unsupervised machine learning technique used for clustering similar data points into groups or clusters. It aims to partition a dataset into K clusters, where each data point belongs to the cluster with the nearest mean (centroid). This application provides an interactive environment to understand and visualize the K-Means algorithm.
Features
- Dataset Generation: Choose different shapes of datasets such as blobs, moons, and circles with varying sizes and numbers of clusters.
- Centroid Initialization: Select different methods for initializing centroids, including random initialization and K-Means++ initialization.
- Step-by-Step Visualization: Observe the step-by-step execution of the K-Means algorithm, including the expectation step and maximization step.
- Inertia Plot: Track the change in inertia (within-cluster sum of squares) over iterations to assess the convergence of the algorithm.
- Silhouette Coefficient: Evaluate the quality of clustering using the silhouette coefficient, which measures the cohesion and separation of clusters.
- Play and Pause Animation: Control the animation of the algorithm with play and pause buttons for better visualization.
- Customizable Parameters: Adjust parameters such as the number of clusters, dataset size, and maximum iterations to explore different scenarios.
How to Run
To run the K-Means Clustering Simulator App locally, follow these steps:
Clone Repository: Clone this repository to your local machine using Git:
git clone https://github.com/yashmaniya0/K-Means-Clustering-Simulator
cd K-Means-Clustering-Simulator
pip install -r requirements.txt
python app.py
Usage
- Select Dataset Shape: Choose the shape of the dataset from the dropdown menu (e.g., blobs, moons, circles).
- Adjust Parameters: Set the dataset size, number of clusters, centroid initialization method, and maximum iterations using the sliders and dropdown menus.
- Generate Dataset and Centroids: Click on the "Generate Data" and "Generate Centroids" buttons to create the dataset and initialize centroids.
- Run Simulation: Start the simulation by clicking on the "Play" button to observe the step-by-step execution of the K-Means algorithm.
- Visualize Results: Watch the animation of the algorithm, explore the inertia plot, and analyze the silhouette coefficient to understand the clustering process.
- Interact with Animation: Use the play, pause, next step, and previous step buttons to control the animation and navigate through iterations.
Dependencies
- Dash: For building interactive web applications.
- Plotly: For creating interactive and customizable plots.
- NumPy: For numerical computations and array manipulations.
- Scikit-learn: For implementing the K-Means algorithm and evaluating clustering metrics.
- Matplotlib: For plotting graphs and visualizations.
- OpenCV: For image processing tasks (optional).
Authors
- Yash Maniya: GitHub Profile
- Tatvam Shah: GitHub Profile