This project focuses on predicting the risk of cardiovascular disease based on patient data. It involves building a machine learning model and deploying it as a RESTful API using FastAPI. This allows users to input patient features and receive a prediction of their CVD risk.
├── datasets/
│ └── cardio-train.csv
├── references/
├── models/ # The dataset used for training
├── notebooks/
│ └── exploratory-data-analysis.ipynb # Notebook for EDA
│ └── model-training.ipynb # Notebook for model training and evaluation
├── src/
│ ├── main.py # FastAPI application
│ └── models/ # Contains the trained ML model and related utilities
│ ├── model.pkl
| |── predictions-input.py
| |── predictions-output.py
│ └── preprocess.py
├── README.md
└── requirements.txtThe dataset used in this project is the "Cardiovascular Disease Dataset" available on Kaggle: https://www.kaggle.com/datasets/sulianova/cardiovascular-disease-dataset.
- A classification model
A FastAPI application (src/main.py) is built to serve the machine learning model. It provides an endpoint where users can send patient data as a JSON payload and receive a prediction of the cardiovascular disease risk.
api/predict: Accepts a JSON payload of patient features and returns the predicted risk.
{
"age": 34,
"gender": "Female",
"height": 112,
"cholesterol": "Well Above Normal",
"gluc": "Normal",
"smoke": "Yes",
"alco": "Yes",
"active": "Active",
"bmi": 21.2,
"age_group": "Senior",
"blood_pressure_category": "Hypertension Stage 1",
"pulse_pressure": 60
}https://cardiovascular-disease-risk-prediction.onrender.com/docs/