This project is a web application built with Django and Scikit-learn to classify Iris flowers based on sepal length, sepal width, petal length, and petal width. The application uses a machine learning model trained on the Iris dataset to predict the species of the flower.
- User input for sepal length, sepal width, petal length, and petal width
- Predicts the species of the Iris flower (setosa, versicolor, virginica)
- Easy-to-use web interface
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/iris-django-model.git cd iris-django-model
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Navigate to the application: Open your browser and go to
http://127.0.0.1:8000/
.
- Enter the sepal length, sepal width, petal length, and petal width in the input form on the home page.
- Submit the form to get the predicted species of the Iris flower.
iris_django_model/
: Main Django project folder.iris_model/
: Django app containing the model, views, and templates.static/
: Static files for the project.templates/
: HTML templates for the project.manage.py
: Django's command-line utility.
The machine learning model is built using Scikit-learn and the Iris dataset. The model is trained to classify the species of an Iris flower based on the following features:
- Sepal Length
- Sepal Width
- Petal Length
- Petal Width
The trained model is saved using joblib
and loaded in the Django application for making predictions.
Contributions are welcome! Please open an issue or submit a pull request for any changes.
This project is licensed under the MIT License.