Kasilanka Bhoopesh Siva Srikar commited on
Commit
535410e
·
1 Parent(s): 7205969

Add README.md with Hugging Face Spaces configuration

Browse files
Files changed (1) hide show
  1. README.md +61 -25
README.md CHANGED
@@ -1,38 +1,74 @@
1
- # Streamlit Inference App
 
 
 
 
 
 
 
 
 
2
 
3
- This app loads your trained models (CatBoost/XGBoost/LightGBM) and optional sklearn preprocessor, then serves batch CSV inference with an optional simple ensemble. No dataset is required at deploy time; users upload CSVs.
4
 
5
- ## Project Layout
6
 
7
- - `streamlit_app.py` – main app
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
- ## Local Preview (optional)
 
 
 
 
 
 
16
 
17
- If you want to run locally without installing ML libs on your laptop, skip. Otherwise:
18
 
19
- ```bash
20
- pip install -r requirements.txt
21
- streamlit run streamlit_app.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  ```
23
 
24
- ## Deploy to Streamlit Cloud
25
 
26
- 1. Push this folder to a public GitHub repo.
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
- ## Preparing Artifacts in Colab
31
 
32
- Artifacts the app can use (any subset works):
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
- The app auto-detects assets and displays metrics if the CSVs are present.
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**