Skip to content
realslimshankyPublic

About

A zoomcamp midterm project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Zoomcamp - Midterm project - Hearty

Problem description

Hearty - A Machine Learning project to train a model over health data allowing it the ability to predict whether a person is likely to get a heart disease or not. A classification model will be trained to derive the outcome i.e. heart disease to be likely i.e. 0 or not i.e. 1.

Local Setup

Simply install uv using the following command and sync dependencies.

pip install uv
uv sync

To run Jupyter Notebook run:

uv run jupyter lab

To run FastAPI server and access interactive API doc run:

uv run fastapi run predict.py

Docker Setup

Using Dockerfile we can create an image with our trained model, run FastAPI server and expose a port to the api:

docker build -t hearty .
docker run -p 8000:8000 -it --rm hearty

Interactive API can then be found here.

EDA

Exploratory Data Analysis is present in notebook.ipynb.

Model training

Model training is done post EDA in notebook.ipynb.

Exporting notebook to script

Model training lives in its own module train.py and can be reproduced using the command

uv run python train.py

Prediction and API in its own module predict.py and can be run using

uv run fastapi run predict.py

Interactive API should be visible here.

Reproducibility

Notebook, model training and prediction api can be easily reproduced as explain in the steps above.

Model deployment

Model is deployed using FastAPI defined in predict.py.

Dependency and enviroment management

Dependency and Virtual Environment is maintained by uv, via pyproject.toml and uv.lock as defined in Local Setup.

Containerization

Dockerfile handles creating image and that can be used to run API container as defined in Docker Setup.

Cloud deployment

Skipped

About

A zoomcamp midterm project.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages