This repository contains a simple web application for Iris classification using a Decision Tree Classifier. The Iris dataset is a popular benchmark dataset in the field of machine learning, consisting of measurements of four features (sepal length, sepal width, petal length, and petal width) of three different Iris flower species (Setosa, Versicolor, and Virginica).
The purpose of this web application is to provide a user interface where users can input the measurements of an Iris flower, and the application will classify it into one of the three species using a pre-trained Decision Tree Classifier model.
- User-friendly web interface for entering Iris flower measurements.
- Real-time classification of Iris flowers using the pre-trained model.
- Display of the predicted Iris species on the web page.
The following dependencies are required to run the web application:
- Flask
- scikit-learn
- numpy
- pandas
- requests
These dependencies can be installed by running the command pip install -r requirements.txt
.
To run the Iris classification web application:
-
Install the required dependencies mentioned in the
requirements.txt
file. -
Ensure that you have the pre-trained Decision Tree Classifier model available. If not, you can train the model using the code provided or load a pre-trained model.
-
Start the web application by running the
server.py
file using the commandpython app.py
. -
Open your web browser and navigate to
http://localhost:5000
to access the application. -
Enter the measurements of an Iris flower in the input fields and click the "predict" button.
-
The predicted Iris species will be displayed on the web page.
A Docker image is provided in this repository to facilitate the deployment of the web application.
To create a Docker image and run the web application using Docker, follow these steps:
-
Install Docker on your machine.
-
Build the Docker image using the provided
Dockerfile
by running the following command in the terminal:docker build -t iris-classification-app .
-
Run the Docker container using the following command:
docker run -p 5000:5000 iris-classification-app
-
Open your web browser and navigate to
http://localhost:5000
to access the application.
server.py
: Contains the Flask web application code for Iris classification.model.py
: Includes the code for training and saving the Decision Tree Classifier model.Dockerfile
: Specifies the Docker image configuration.requirements.txt
: Lists the required dependencies for running the application.model.pkl
: stores the pretrained model.
The provided web application demonstrates how to perform Iris classification using a pre-trained Decision Tree Classifier model. Users can input the measurements of an Iris flower through the web interface, and the application will predict its species in real-time.
Please refer to the source code and the accompanying comments for more detailed information about the implementation and customization options for the web application.