File size: 1,528 Bytes
c4f71da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
license: cc-by-4.0
library_name: scikit-learn
tags:
- regression
- tabular
- scikit-learn
- education
datasets:
- "heart-failure"
---

# Heart Failure Linear Regression Model

**Author:** Ella Carlotto  
**Created:** November 2025  
**Library:** scikit-learn  
**Dataset:** UCI Heart Failure Clinical Records  
**Task:** Tabular regression on a binary target (`DEATH_EVENT`)

## Model Description
This Linear Regression model predicts the likelihood of death (`DEATH_EVENT`) based on clinical features from the UCI Heart Failure Clinical Records dataset. All features are numeric, and the model was trained as a simple baseline regression example to demonstrate packaging and upload for educational use.

**Target:** `DEATH_EVENT` (0 = survived, 1 = death)  
**Output:** Continuous score; higher values indicate higher likelihood of death.

## Files Included
- heart_failure_model.pkl — trained scikit-learn model  
- heart_failure_config.json — model configuration metadata  
- heart_failure_test_data.csv — held-out test dataset for evaluation  

## Intended Uses and Limitations
- For educational and demonstration purposes only  
- Not validated for medical, diagnostic, or clinical use  
- Do not use for real-world predictions or patient decisions  

## Example Usage
```python
import pickle, pandas as pd
with open("heart_failure_model.pkl", "rb") as f:
    model = pickle.load(f)

df = pd.read_csv("heart_failure_test_data.csv")
X = df.drop(columns=["DEATH_EVENT"])
y_pred = model.predict(X)
print(y_pred[:5])