This is a FastAPI application that predicts the species of an Iris flower based on its sepal length, sepal width, petal length, and petal width. It utilizes machine learning to provide predictions along with the probabilities of each Iris species.
url - https://iris-fastapi-meer.onrender.com/
- User-friendly web interface to input Iris flower measurements.
- Predictions of Iris species (Setosa, Versicolor, or Virginica).
- Displays probabilities for each species.
To run this application, you need the following dependencies:
- Python 3.12.4
- FastAPI
- Jinja2
- Uvicorn
- pydantic
- scikit-learn
You can install all dependencies using the following command:
pip install -r requirements.txt
-
Clone the repository:
git clone https://github.com/utkarshg1/FastAPI-ML.git cd FastAPI-ML
-
Set Up Python Virtual environment
python -m venv env
-
Activaate virtual environment
source env/bin/activate # env\Script\activate.bat for Windows machine
-
Upgrade pip
python -m pip install --upgrade pip
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python main.py
-
Open your web browser and go to
http://localhost:8000
. You will see a form where you can input the sepal and petal measurements for the Iris flower. -
After submitting the form, the application will display the predicted species along with the probabilities for each species.
Renders the form where users can input the measurements for the Iris flower.
Handles form submission and returns the predicted Iris species along with the probabilities of each species.
Here's an example of how to use the web interface:
-
Input the following measurements into the form:
- Sepal length: 5.1
- Sepal width: 3.5
- Petal length: 1.4
- Petal width: 0.2
-
Click the submit button.
-
The application will display the predicted species along with the probabilities of each species.
Dockerhub link - https://hub.docker.com/r/utkarshg1/fastapi-iris
This project is licensed under the Apache License 2.0, See the LICENSE file for more details.
- This project is built using FastAPI.
- The machine learning model used for predictions is powered by scikit-learn.