Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,87 +1,91 @@
|
|
| 1 |
-
---
|
| 2 |
-
language: en
|
| 3 |
-
license: mit
|
| 4 |
-
library_name: scikit-learn
|
| 5 |
-
tags:
|
| 6 |
-
- tabular-classification
|
| 7 |
-
- healthcare
|
| 8 |
-
- clinical-prediction
|
| 9 |
-
- risk-stratification
|
| 10 |
-
- explainable-ai
|
| 11 |
-
metrics:
|
| 12 |
-
- roc_auc
|
| 13 |
-
- accuracy
|
| 14 |
-
- recall
|
| 15 |
-
- f1
|
| 16 |
-
model-index:
|
| 17 |
-
- name: heart-attack-risk-classifier
|
| 18 |
-
results:
|
| 19 |
-
- task:
|
| 20 |
-
type: tabular-classification
|
| 21 |
-
metrics:
|
| 22 |
-
- type: roc_auc
|
| 23 |
-
value: 0.912
|
| 24 |
-
- type: recall
|
| 25 |
-
value: 0.923
|
| 26 |
-
- type: f1
|
| 27 |
-
value: 0.884
|
| 28 |
-
---
|
| 29 |
-
|
| 30 |
-
#
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
---
|
| 38 |
-
|
| 39 |
-
##
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
#
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
library_name: scikit-learn
|
| 5 |
+
tags:
|
| 6 |
+
- tabular-classification
|
| 7 |
+
- healthcare
|
| 8 |
+
- clinical-prediction
|
| 9 |
+
- risk-stratification
|
| 10 |
+
- explainable-ai
|
| 11 |
+
metrics:
|
| 12 |
+
- roc_auc
|
| 13 |
+
- accuracy
|
| 14 |
+
- recall
|
| 15 |
+
- f1
|
| 16 |
+
model-index:
|
| 17 |
+
- name: heart-attack-risk-classifier
|
| 18 |
+
results:
|
| 19 |
+
- task:
|
| 20 |
+
type: tabular-classification
|
| 21 |
+
metrics:
|
| 22 |
+
- type: roc_auc
|
| 23 |
+
value: 0.912
|
| 24 |
+
- type: recall
|
| 25 |
+
value: 0.923
|
| 26 |
+
- type: f1
|
| 27 |
+
value: 0.884
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# Clinical Heart Attack Risk Prediction Model π«
|
| 31 |
+
|
| 32 |
+
A calibrated tabular gradient boosting classifier trained to predict acute myocardial infarction risk from non-invasive clinical intake markers.
|
| 33 |
+
|
| 34 |
+
- **Associated Space**: [Clinical Heart Attack Risk Triage Calculator](https://huggingface.co/spaces/Jayan12321/clinical-heart-risk-calculator)
|
| 35 |
+
- **Author**: [Jayan Gupta](https://huggingface.co/Jayan12321)
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## π― Clinical Sensitivity & Objective
|
| 40 |
+
In medical triage modeling, false negatives are far more critical than false positives. This classifier is tuned for high sensitivity, achieving **>92% Recall** on cardiac event detection to minimize life-threatening missed diagnoses.
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## π Features Required for Inference
|
| 45 |
+
|
| 46 |
+
| Feature | Description | Values / Range |
|
| 47 |
+
|---|---|---|
|
| 48 |
+
| `age` | Patient age | Years |
|
| 49 |
+
| `sex` | Biological sex | `1` = male, `0` = female |
|
| 50 |
+
| `cp` | Chest Pain type | `0`: Typical Angina, `1`: Atypical, `2`: Non-anginal, `3`: Asymptomatic |
|
| 51 |
+
| `trestbps` | Resting Blood Pressure | mm Hg on admission |
|
| 52 |
+
| `chol` | Serum Cholesterol | mg/dl |
|
| 53 |
+
| `fbs` | Fasting Blood Sugar | `1` if > 120 mg/dl, `0` otherwise |
|
| 54 |
+
| `restecg` | Resting ECG results | `0`: Normal, `1`: ST-T wave abnormality, `2`: Left ventricular hypertrophy |
|
| 55 |
+
| `thalach` | Maximum Heart Rate achieved | bpm |
|
| 56 |
+
| `exang` | Exercise Induced Angina | `1` = yes, `0` = no |
|
| 57 |
+
| `oldpeak` | ST depression induced by exercise | Relative to rest (float) |
|
| 58 |
+
| `slope` | Slope of peak exercise ST segment | `0`: Upsloping, `1`: Flat, `2`: Downsloping |
|
| 59 |
+
| `ca` | Number of major vessels colored by flourosopy | `0-3` |
|
| 60 |
+
| `thal` | Thalassemia status | `1`: Normal, `2`: Fixed defect, `3`: Reversible defect |
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## π» Python Quickstart
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
import joblib
|
| 68 |
+
from huggingface_hub import hf_hub_download
|
| 69 |
+
|
| 70 |
+
# Download model from Hugging Face
|
| 71 |
+
model_path = hf_hub_download(
|
| 72 |
+
repo_id="Jayan12321/heart-attack-risk-classifier",
|
| 73 |
+
filename="model.joblib"
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
# Load classifier
|
| 77 |
+
model = joblib.load(model_path)
|
| 78 |
+
|
| 79 |
+
# Sample patient features
|
| 80 |
+
# [age, sex, cp, trestbps, chol, fbs, restecg, thalach, exang, oldpeak, slope, ca, thal]
|
| 81 |
+
patient_features = [[57, 1, 2, 130, 236, 0, 0, 174, 0, 0.0, 1, 1, 2]]
|
| 82 |
+
|
| 83 |
+
# Predict calibrated risk probability
|
| 84 |
+
risk_prob = model.predict_proba(patient_features)[0, 1]
|
| 85 |
+
print(f"Predicted Cardiac Event Probability: {risk_prob:.2%}")
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## β οΈ Educational Disclaimer
|
| 91 |
+
*This model is provided solely for educational and research demonstration purposes. It is not approved as a medical diagnostic device and must not be used for actual patient diagnosis.*
|