This repository contains a Python notebook that demonstrates the use of KMeans clustering algorithm on the famous Iris dataset.
The Iris dataset is a classic dataset in machine learning and is often used as a beginner's dataset for classification and clustering tasks. It contains measurements for 150 iris flowers from three different species - Setosa, Versicolor, and Virginica. The measurements include the length and width of the sepals and petals in centimeters.
To run the notebook, ensure that you have the following libraries installed:
- pandas
- numpy
- matplotlib
- seaborn
- scikit-learn
- pip install pandas numpy matplotlib seaborn scikit-learn
- Loading the dataset
- Exploratory Data Analysis (EDA)
- Preprocessing the data
- Applying KMeans clustering algorithm
- Visualizing the clusters
- In this notebook, I have used scikit-learn library to apply KMeans clustering algorithm on the Iris dataset. I have also visualized the clusters using matplotlib and seaborn libraries.
To run the notebook, simply open it in Jupyter Notebook or JupyterLab and run each cell sequentially. You can modify the code as per your requirements and experiment with different values of K (number of clusters).
KMeans clustering is a powerful unsupervised learning algorithm that can be used for clustering tasks. In this notebook, I have demonstrated the use of KMeans clustering on the Iris dataset and visualized the clusters using different techniques.
I hope this notebook helps you understand the basics of KMeans clustering and how it can be applied to real-world datasets. If you have any questions or feedback, feel free to reach out to me.
Happy clustering!