This project demonstrates a basic machine learning workflow using the popular Scikit-Learn library in Python. The script builds a Decision Tree Classifier to classify iris flowers into three species: Setosa, Versicolour, and Virginica based on their features (sepal length, sepal width, petal length, petal width).
This project provides a simple example of how to build, train, and evaluate a machine learning model in Python using Scikit-Learn. The Iris dataset is used, which is a standard dataset in the field of machine learning and is ideal for beginners to understand the basic concepts of classification.
Ensure you have the following installed:
If you haven’t already installed Scikit-Learn, you can do so using pip:
pip install scikit-learn
Clone the Repository:
Clone the repository to your local machine:
git clone https://github.com/your-username/iris-classification.git
Navigate to the Directory:
Go to the project directory:
cd iris-classification
Run the Script:
Run the script using Python:
python iris_classification.py
Once the script is running, it will:
Running the script will produce an output similar to:
Model Accuracy: 0.98
Classification Report:
precision recall f1-score support
setosa 1.00 1.00 1.00 16
versicolor 1.00 0.92 0.96 12
virginica 0.92 1.00 0.96 12
accuracy 0.98 40
macro avg 0.98 0.98 0.98 40
weighted avg 0.98 0.98 0.98 40
Predicted Species: setosa
To predict the species of a new iris flower, you can modify the new_sample
variable in the script:
new_sample = [[5.0, 3.6, 1.4, 0.2]] # Example features: sepal length, sepal width, petal length, petal width
Run the script again to see the predicted species.
Contributions are welcome! If you have suggestions for new features, improvements, or bug fixes, feel free to create a pull request or open an issue.
git clone https://github.com/your-username/iris-classification.git
git checkout -b feature/your-feature-name
git commit -m "Add: feature description"
git push origin feature/your-feature-name
This project is licensed under the MIT License - see the LICENSE file for details.
Thank you for using the Iris Flower Classification script! Feel free to reach out if you have any questions or feedback. Happy learning! 🌸🚀