Initial upload of model and scaler
Browse files
README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- health
|
| 6 |
+
- medical
|
| 7 |
+
- cardiovascular
|
| 8 |
+
- risk-prediction
|
| 9 |
+
- scikit-learn
|
| 10 |
+
- xgboost
|
| 11 |
+
- healthcare
|
| 12 |
+
- heart-disease
|
| 13 |
+
metrics:
|
| 14 |
+
- accuracy
|
| 15 |
+
- f1
|
| 16 |
+
- roc_auc
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# ❤️ Cardiovascular Health Risk Predictor
|
| 20 |
+
|
| 21 |
+
This model predicts the risk of cardiovascular issues based on personal and clinical bio-metrics. It was trained on the Cardiovascular Disease dataset and is intended for informational and research purposes.
|
| 22 |
+
|
| 23 |
+
## 🚀 Model Details
|
| 24 |
+
- **Task**: Binary Classification (Risk / No Risk)
|
| 25 |
+
- **Framework**: Scikit-Learn / Joblib
|
| 26 |
+
- **Features**:
|
| 27 |
+
- `age`: Age in years
|
| 28 |
+
- `gender`: Gender (mapped)
|
| 29 |
+
- `height`: Height in cm
|
| 30 |
+
- `weight`: Weight in kg
|
| 31 |
+
- `systolic_bp`: Systolic Blood Pressure
|
| 32 |
+
- `diastolic_bp`: Diastolic Blood Pressure
|
| 33 |
+
- `cholesterol`: Cholesterol Level (mapped)
|
| 34 |
+
- `gluc`: Glucose Level (mapped)
|
| 35 |
+
- `smoke`: Smoker status
|
| 36 |
+
- `alco`: Alcohol consumption
|
| 37 |
+
- `active`: Physical activity
|
| 38 |
+
- `bmi`: Body Mass Index (calculated)
|
| 39 |
+
- `pulse_pressure`: Difference between Systolic and Diastolic BP
|
| 40 |
+
|
| 41 |
+
## 📊 Performance
|
| 42 |
+
The model has been optimized for high recall and ROC-AUC to ensure potential risks are not missed. (Detailed metrics available in training logs).
|
| 43 |
+
|
| 44 |
+
## 🛠️ Usage
|
| 45 |
+
You can load the model and scaler using `pickle` or `joblib`:
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
import pickle
|
| 49 |
+
import pandas as pd
|
| 50 |
+
|
| 51 |
+
# Load resources
|
| 52 |
+
with open('model.pkl', 'rb') as f:
|
| 53 |
+
model = pickle.load(f)
|
| 54 |
+
with open('scaler.pkl', 'rb') as f:
|
| 55 |
+
scaler = pickle.load(f)
|
| 56 |
+
|
| 57 |
+
# Sample prediction
|
| 58 |
+
data = pd.DataFrame({...}) # Match feature order
|
| 59 |
+
data[scaler_cols] = scaler.transform(data[scaler_cols])
|
| 60 |
+
prediction = model.predict(data)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## ⚠️ Disclaimer
|
| 64 |
+
**This tool uses a machine learning model for informational purposes only. It is NOT a substitute for professional medical advice, diagnosis, or treatment. Always consult with a qualified healthcare provider for any questions regarding a medical condition.**
|