Skip to content

Training and deploying LightGBM Model with MLFlow, fastapi, App Engine and github actions

Notifications You must be signed in to change notification settings

amine-akrout/mental_health_risk

Repository files navigation

MLOps with MLflow, FastApi, App Engine and Github Actions

Deploy to App Engine

Data Information

Data used in the project can be found on UCI Machine Learning Repository

Data has been collected from different hospitals, community clinics, maternal health cares from the rural areas of Bangladesh through the IoT based risk monitoring system.

Attribute Information:

  • Age: Any ages in years when a women during pregnant.
  • SystolicBP: Upper value of Blood Pressure in mmHg, another significant attribute during pregnancy.
  • DiastolicBP: Lower value of Blood Pressure in mmHg, another significant attribute during pregnancy.
  • BS: Blood glucose levels is in terms of a molar concentration, mmol/L.
  • HeartRate: A normal resting heart rate in beats per minute.
  • Risk Level: Predicted Risk Intensity Level during pregnancy considering the previous attribute.

Workflow Architecture

workflow_architecture

Requirements

  • Python 3.8
  • Docker
  • Google Cloud Plateform account

Quick Start

  • Clone the repository
git clone https://github.com/amine-akrout/mental_health_risk
  • Create a virtual and install requirements
python -m venv
pip install -r requirements.txt
  • Train LightGBM using Pycaret and log metrics and artifacts with MLflow
python ./model.py

MLflow experiment demo_webapp

Test locally

To test the web app locally using docker, start by building the image from the Dockerfile

docker build --pull --rm -f "Dockerfile" -t mentalhealthrisk:latest "."
docker run -p 8080:8080 mentalhealthrisk

the Web app should be runnining on http://localhost:8080/

Deploy to Google Cloud App Engine

gcloud app deploy

CI/CD workflow

Using Github actions and app_engine.yml, we could continuously deploy the web app by simply using the term "deploy" in the commit message when pushing to main branch

Demo

demo_webapp

References:

Releases

No releases published

Packages

No packages published

Languages