A web-based Machine Learning API built with Flask that serves real-time predictions from a trained model. The API is containerised with Docker and deployed on Render, making it accessible for integration with frontend applications or other services.
For a step-by-step description of the application, check out this hands-on demonstration: https://medium.com/@hello.gradientthoughts/building-and-hosting-a-machine-learning-model-with-flask-and-docker-1cd4f89cf256
- Serve ML predictions: Host a trained model and provide predictions via a RESTful API.
- JSON-based endpoints: Accepts feature inputs in JSON format.
- Error handling: Returns informative error messages for invalid requests.
- CORS enabled: Supports frontend integration from other domains.
- Dockerized: Ensures environment consistency and easy deployment.
Deploy_ML/
│
├── app/
│ ├── main.py # Flask application
│ ├── model.py # Model loading and prediction
│
├── models/
│ └── model.joblib # Trained ML model
│
├── src/
│ └── main_model.py # Script for data preprocessing and model training
|
├── f1_dnf.csv # Dataset to train the model
├── test.py # Mini-test script for predictions
├── requirements.txt # Required libraries
├── Dockerfile
└── README.md
git clone https://github.com/Pranav-Bhatlapenumarthi/Deploy_ML.git
cd Deploy_ML
pip install -r requirements.txt
python app/main.py
docker build -t ml-flask .
docker run -p 8000:8000 ml-flask