Iris Species Prediction App with FastAPI and Scikit-Learn
Overview
This Docker image hosts an Iris Species Prediction web application built with FastAPI and Scikit-Learn . The app allows users to input sepal and petal measurements of iris flowers and returns a prediction of the iris species, along with the associated probabilities for each species. The model is trained using the classic Iris dataset.
Github Repository Link
Github Link - https://github.com/utkarshg1/FastAPI-ML
Demo application link
Demo Link - https://iris-fastapi-meer.onrender.com/
Features
Web UI : A user-friendly interface built with Jinja2 templates to input iris flower measurements.
Prediction API : Utilizes a pre-trained Scikit-Learn model to predict the species of iris flowers based on user input.
Real-Time Inference : Provides the prediction probabilities for each of the three iris species (setosa, versicolor, and virginica).
FastAPI : An efficient, high-performance, asynchronous web framework for serving the app.
Dockerized : Fully containerized for easy deployment and scaling.
Technologies Used
FastAPI : For building the web application and RESTful API.
Scikit-Learn : For machine learning model training and prediction.
Jinja2 : For HTML templating.
Docker : For containerizing the application, ensuring portability and consistency across different environments.
How to Use
Pull the Image :
docker pull utkarshg1/fastapi-iris
Copy
Run the Container :
docker run -d -p 8000:8000 utkarshg1/fastapi-iris:latest
Copy
Access the Application :
Open your web browser and go to http://localhost:8000 to start making predictions.
Endpoints
GET / : Displays the iris prediction form.
POST /predict : Submits the form data and returns the predicted species along with probabilities.
Environment Variables
UVICORN_HOST : Set the host for the Uvicorn server (default: 0.0.0.0).
UVICORN_PORT : Set the port for the Uvicorn server (default: 8000).
Example Usage
Input sepal length, sepal width, petal length, and petal width in the form.
Click "Predict" to get the predicted species and its associated probabilities.
License
This project is licensed under the Apache License 2.0
Contributing
Feel free to submit issues or pull requests to improve the app.