Spaces:
Sleeping
Sleeping
Kasilanka Bhoopesh Siva Srikar
commited on
Commit
·
535410e
1
Parent(s):
7205969
Add README.md with Hugging Face Spaces configuration
Browse files
README.md
CHANGED
|
@@ -1,38 +1,74 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
- `requirements.txt` – dependencies (installed on Streamlit Cloud)
|
| 9 |
-
- `.streamlit/config.toml` – dark theme
|
| 10 |
-
- `model_assets/` – place your artifacts here:
|
| 11 |
-
- `CatBoost.joblib` / `XGBoost.joblib` / `LightGBM.joblib` (or any of the alternative names used in the notebook)
|
| 12 |
-
- `preprocessor.joblib` (recommended)
|
| 13 |
-
- optional: `feature_names.json`, `hybrid_metrics.csv`, `model_metrics_summary.csv`
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
```
|
| 23 |
|
| 24 |
-
##
|
| 25 |
|
| 26 |
-
|
| 27 |
-
2. On Streamlit Cloud, create a new app pointing to that repo, file `streamlit_app.py`.
|
| 28 |
-
3. In the repo, put your artifacts inside `model_assets/`.
|
| 29 |
|
| 30 |
-
##
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- Models: `CatBoost.joblib`, `XGBoost.joblib`, `LightGBM.joblib` (supports common alt names)
|
| 34 |
-
- Preprocessor: `preprocessor.joblib`
|
| 35 |
-
- Optional: `feature_names.json`, `hybrid_metrics.csv`, `model_metrics_summary.csv`
|
| 36 |
|
| 37 |
-
|
| 38 |
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Heart Attack Risk Prediction
|
| 3 |
+
emoji: ❤️
|
| 4 |
+
colorFrom: red
|
| 5 |
+
colorTo: pink
|
| 6 |
+
sdk: docker
|
| 7 |
+
sdk_version: "4.44.0"
|
| 8 |
+
app_file: streamlit_app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
|
| 12 |
+
# ❤️ Heart Attack Risk Prediction: An Ensemble Modeling Approach
|
| 13 |
|
| 14 |
+
Advanced machine learning ensemble combining XGBoost, CatBoost, and LightGBM for accurate cardiovascular risk assessment.
|
| 15 |
|
| 16 |
+
## 🎯 Features
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
- **Ensemble Model**: Combines XGBoost (5%), CatBoost (85%), and LightGBM (10%) for optimal performance
|
| 19 |
+
- **High Accuracy**: ~80.77% accuracy with ~93.27% recall
|
| 20 |
+
- **Comprehensive Risk Assessment**: Analyzes multiple health factors including:
|
| 21 |
+
- Demographics (Age, Gender, Height, Weight)
|
| 22 |
+
- Blood Pressure and Cholesterol levels
|
| 23 |
+
- Lifestyle factors (Smoking, Alcohol, Physical Activity)
|
| 24 |
+
- Derived health metrics (BMI, BP categories)
|
| 25 |
|
| 26 |
+
## 📊 Model Performance
|
| 27 |
|
| 28 |
+
- **Accuracy**: 80.77%
|
| 29 |
+
- **Recall**: 93.27%
|
| 30 |
+
- **ROC-AUC**: 92.50%
|
| 31 |
+
|
| 32 |
+
## 🚀 Usage
|
| 33 |
+
|
| 34 |
+
1. Enter your health information in the input form
|
| 35 |
+
2. Click "Predict Heart Attack Risk"
|
| 36 |
+
3. View your personalized risk assessment with:
|
| 37 |
+
- Overall risk percentage
|
| 38 |
+
- Individual model predictions
|
| 39 |
+
- Key risk factors identified
|
| 40 |
+
- Detailed model breakdown
|
| 41 |
+
|
| 42 |
+
## 🔬 Technical Details
|
| 43 |
+
|
| 44 |
+
### Models Used
|
| 45 |
+
- **XGBoost**: Gradient boosting with optimized hyperparameters
|
| 46 |
+
- **CatBoost**: Categorical boosting with balanced class weights
|
| 47 |
+
- **LightGBM**: Light gradient boosting machine
|
| 48 |
+
- **Ensemble**: Weighted combination of all three models
|
| 49 |
+
|
| 50 |
+
### Optimization
|
| 51 |
+
- Multi-objective optimization for accuracy and recall
|
| 52 |
+
- Threshold optimization for optimal performance
|
| 53 |
+
- Feature engineering with derived health metrics
|
| 54 |
+
|
| 55 |
+
## 📝 Citation
|
| 56 |
+
|
| 57 |
+
If you use this model in your research, please cite:
|
| 58 |
+
|
| 59 |
+
```
|
| 60 |
+
Heart Attack Risk Prediction: An Ensemble Modeling Approach
|
| 61 |
+
Using XGBoost, CatBoost, and LightGBM
|
| 62 |
```
|
| 63 |
|
| 64 |
+
## ⚠️ Disclaimer
|
| 65 |
|
| 66 |
+
This tool is for educational and research purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
## 📧 Contact
|
| 69 |
|
| 70 |
+
For questions or issues, please open an issue on the repository.
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
+
---
|
| 73 |
|
| 74 |
+
**Built with ❤️ using Streamlit, XGBoost, CatBoost, and LightGBM**
|