A production-ready machine learning web application for cardiovascular disease risk prediction, built with Streamlit and powered by a GradientBoostingClassifier trained on 70,000 patient records from the Kaggle Cardiovascular Disease dataset. The model uses 12 clinically relevant and lifestyle-linked features, including age, BMI, blood pressure, cholesterol, glucose, smoking, alcohol consumption, and physical activity, and achieves approximately 73% accuracy in binary risk classification.
Try the deployed app here:
- Real-time BMI calculation from height and weight inputs
- Risk probability gauge/progress indicator for predicted cardiovascular risk
- Blood pressure category display (Normal, Elevated, High)
- BMI category display (Underweight, Normal, Overweight, Obese)
- 12-feature patient input form aligned with model training schema
This project uses the Kaggle Cardiovascular Disease Dataset (Sulianova).
- Source: https://www.kaggle.com/datasets/sulianova/cardiovascular-disease-dataset
- Total records: 70,000
- Format: semicolon-separated (
;) CSV
| Feature | Description |
|---|---|
age |
Age in days (converted to years during preprocessing) |
gender |
Biological sex encoded as categorical value |
height |
Height in centimeters |
weight |
Weight in kilograms |
ap_hi |
Systolic blood pressure |
ap_lo |
Diastolic blood pressure |
cholesterol |
Cholesterol category |
gluc |
Glucose category |
smoke |
Smoking status |
alco |
Alcohol consumption status |
active |
Physical activity status |
cardio |
Target label (0: low risk, 1: cardiovascular disease risk) |
The model development workflow follows this sequence:
- Data cleaning (including outlier removal)
- Feature engineering (BMI creation and age conversion from days to years)
- Standardization using
StandardScaler - Dimensionality reduction using
LinearDiscriminantAnalysis (LDA) - Classification using
GradientBoostingClassifier
git clone https://github.com/tejaswirajgit/cardio
cd cardio
pip install -r requirements.txt
python train_save_model.py
streamlit run app.pyThis project is aligned with the research work:
Cardiovascular Disease Prediction and Prevention: Exploring Novel Techniques and Applications Using Machine Learning
12th International Conference, 2023
By Tejaswi Raj
Tejaswi Raj
ML Research Engineer
Chandigarh University | DRDO | IIT Mandi
GitHub: https://github.com/tejaswirajgit