Skip to content

A deployed machine learning model that predicts patient medical charges based on demographic and health data. Features a Flask API, a web front-end, and is containerized with Docker for deployment on Azure.

License

Notifications You must be signed in to change notification settings

PierreExeter/MLOps-Pipeline-Deployment

Repository files navigation

MLOps Pipeline Deployment

GitHub Actions Workflow Status Read the Docs GitHub License

app_screenshot

VIEW DEPLOYED APP

This project demonstrates a MLOps pipeline for deploying a machine learning model into a production-ready web application. The goal is to help an insurance company forecast patient charges using input like age, gender, BMI, number of children, and smoking status.

The solution includes:

  • A machine learning model trained to predict insurance charges
  • A Flask back-end to serve predictions
  • A HTML / CSS front-end for user input
  • A CI/CD pipeline with Github Actions
  • Unit tests with Pytest
  • Containerization with Docker
  • Automatic cloud deployment on Microsoft Azure
  • A product documentation

architecture_diagram

Architecture diagram

Install

Docker install (recommended)

  1. Build the image
docker build -t insurancemodel.azurecr.io/mlops-insurance-prediction:latest .
  1. Run the container
docker run -d -p 5000:5000 insurancemodel.azurecr.io/mlops-insurance-prediction

The web app is served on http://localhost:5000/.

Local install

  1. Clone the repository
git clone https://github.com/PierreExeter/MLOps-Pipeline-Deployment
  1. Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate the environment
uv venv --python 3.11
source .venv/bin/activate
  1. Install the dependencies
uv pip install -r requirements.txt
  1. Train the model
python src/train_model.py
  1. Run the app locally
# development
python src/app.py

# production
python src/app.py --production

The web app is served on http://localhost:5000/.

Documentation

VIEW DOCUMENTATION

About

A deployed machine learning model that predicts patient medical charges based on demographic and health data. Features a Flask API, a web front-end, and is containerized with Docker for deployment on Azure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published