Machine Learning project to classify Iris flowers using Random Forest Classifier with EDA, visualization and feature importance analysis.
This project uses Machine Learning to classify Iris flowers into three species:
- 🌺 Iris Setosa
- 🌼 Iris Versicolor
- 🌸 Iris Virginica
The model predicts flower species based on sepal and petal measurements.
The dataset contains 150 flower samples with the following features:
- Sepal Length
- Sepal Width
- Petal Length
- Petal Width
Target Variable: Species
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-Learn
- Data Loading
- Data Exploration
- Data Visualization
- Data Preprocessing
- Train-Test Split
- Model Training
- Model Evaluation
- Feature Importance Analysis
- New Sample Prediction
Algorithm: Random Forest Classifier
Parameters:
- n_estimators = 100
- random_state = 42
- Model Accuracy: 90%
- Classification Report Generated
- Confusion Matrix Visualized
- Feature Importance Analysis Completed
- Petal Length and Petal Width are the most important features
- The dataset is balanced with 50 samples per species
- Random Forest classified Iris-Setosa with 100% confidence
- Clear separation visible between species in pairplot visualizations
- Clone this repository
- Install required libraries:
pip install pandas numpy matplotlib seaborn scikit-learn- Open the notebook in Jupyter:
jupyter notebook iris_classification.ipynb- Run all cells sequentially
Shreyansh Gupta B.Tech (CSDS) Galgotias College of Engineering & Technology