Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cardiovascular Disease Risk Prediction

Python License: MIT Pandas Scikit-Learn FastAPI

Overview

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.

Project Structure

├── 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.txt

Data Source

The dataset used in this project is the "Cardiovascular Disease Dataset" available on Kaggle: https://www.kaggle.com/datasets/sulianova/cardiovascular-disease-dataset.

Machine Learning Model

  • A classification model

FastAPI Application

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.

Endpoints

  • api/predict: Accepts a JSON payload of patient features and returns the predicted risk.

Example Request

  {
    "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
  }

Access the API at:

https://cardiovascular-disease-risk-prediction.onrender.com/docs/

Author

Twitter @m_obadara

About

Cardiovascular disease risk prediction project leveraging Python, pandas, scikit-learn for modeling, and FastAPI for API deployment.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages