This is a beginner-friendly machine learning project that classifies iris flowers into three species (Setosa, Versicolor, and Virginica) based on their sepal and petal measurements.
The Iris dataset is a classic dataset in machine learning and statistics. It contains 150 samples from three species of iris flowers:
- Setosa
- Versicolor
- Virginica
Each sample has four features:
- Sepal length
- Sepal width
- Petal length
- Petal width
- Data exploration and visualization
- Data preprocessing and scaling
- Model training using Random Forest Classifier
- Model evaluation with accuracy metrics
- Prediction functionality for new samples
- Python 3.7+
- scikit-learn
- pandas
- matplotlib
- seaborn
-
Clone this repository:
git clone <repository-url> -
Navigate to the project directory:
cd iris_classifier -
Install the required packages:
pip install -r requirements.txt
Run the classifier:
python iris_classifier.pyThe script will:
- Load and explore the Iris dataset
- Visualize the data distributions
- Train a Random Forest model
- Evaluate the model performance
- Show an example prediction
To run the web interface:
python web_app.pyThen open your browser to http://127.0.0.1:5000 to use the interactive classifier.
iris_classifier.py: Main script containing the classifier implementationsimple_iris_classifier.py: Simplified version of the classifierweb_app.py: Web interface for the classifierrequirements.txt: List of required Python packagesREADME.md: Project documentationCONTRIBUTING.md: Guide for contributing to the projectiris_data_visualization.png: Visualization of the datasetiris_correlation_matrix.png: Feature correlation heatmapiris_confusion_matrix.png: Model evaluation confusion matrixiris_feature_importance.png: Feature importance chart
By working on this project, you will learn:
- How to load and explore datasets using pandas
- Data visualization techniques with matplotlib and seaborn
- Data preprocessing and feature scaling
- How to train and evaluate machine learning models
- Model evaluation metrics and techniques
- How to make predictions with trained models
- Try different classification algorithms (SVM, KNN, Logistic Regression)
- Implement cross-validation for more robust evaluation
- Add more visualization types
- Create a simple web interface using Flask or Streamlit
- Experiment with hyperparameter tuning
This project is designed for educational purposes. Feel free to:
- Fork the repository
- Make improvements
- Submit pull requests
This project is open source and available under the MIT License.