File size: 4,426 Bytes
3d28674
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
058b027
3d28674
 
 
 
 
 
 
 
 
 
 
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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
task_categories:
- tabular-classification
language:
- en
tags:
- health
- medical
size_categories:
- 1K<n<10K
---
# ❤️ Heart Disease — Exploratory Data Analysis  

## 👤 Author
**Oded Fuchs**

---

## 🎯 Project Goal
The goal of this project is to explore which factors are most strongly related to heart disease,  
using statistical analysis and data visualization.

---

## 🔍 Research Question  
> **Which factors have the strongest impact on the likelihood of heart disease?**

---

## 📦 Dataset
- Source: Kaggle  
- Format: CSV  
- ~302 samples  
- Contains various clinical features

### Target  
`target`  
- **1 = Heart disease**
- **0 = No heart disease**

---

## 🏷 Feature Overview
| Feature | Description |
|---------|-------------|
| age | Age |
| sex | 0 = female, 1 = male |
| cp | Chest pain type |
| trestbps | Resting blood pressure |
| chol | Cholesterol |
| fbs | Fasting blood sugar |
| restecg | Resting ECG results |
| thalach | Maximum heart rate |
| exang | Exercise-induced angina |
| oldpeak | ST depression |
| slope | Slope of ST |
| ca | Number of major vessels |
| thal | Thallium test result |
| target | Heart disease indicator |

---

# 🔧 Data Preparation

### ✅ Cleaning Steps
- Checked for missing values — none found
- Checked for duplicate records
- Verified valid ranges
- Adjusted and simplified column names

---

# 📊 Exploratory Data Analysis (EDA)

## Target Distribution

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/ytjKjluhwJL6I66y5wEEF.png)

---

## ✅ Key Features & Insights

### 1) Age
Patients with heart disease are slightly younger on average.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/HJfXSFOxtjcb5yfjj2Cbx.png)

---

### 2) Chest Pain (cp)
One of the strongest predictors:  
Higher chest pain type is strongly linked to heart disease.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/_zR4KdtpHuVmrYEiYSoFy.png)

---

### 3) Max Heart Rate (thalach)
Patients with heart disease tend to have a higher maximum heart rate.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/SklL0tx4sze3Ss6hDjclP.png)

---

### 4) ST Depression (oldpeak)
Lower oldpeak values are more common among heart-disease patients.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/CNk3OjhxqjjCrQCwCT_0w.png)

---

### 5) Exercise-Induced Angina (exang)
Most patients **do not** experience chest pain during exercise.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/vqYWmlwiiBGCykqaKvgST.png)

---

### 6) Thal
Moderate difference between groups, still noticeable.  

![image](https://cdn-uploads.huggingface.co/production/uploads/6909b9db75ba88c195adac42/dlQl3wxYVdf5R6iFQ-s00.png)

---

# 📑 Summary Table

| Feature | No Disease (0) | Disease (1) | Insight |
|---------|----------------|-------------|---------|
| cp | 0.48 | 1.38 | Strong relationship |
| thalach | 139 | 159 | Higher among disease |
| oldpeak | 1.60 | 0.57 | Lower among disease |
| exang | 0.55 | 0.14 | Less common in disease |
| age | 56.6 | 52.4 | Slightly younger |
| chol | 251 | 241 | Small difference |
| ca | 1.16 | 0.37 | ⚠️ Opposite trend |
| trestbps | 134 | 129 | Weak effect |
| thal | 2.54 | 2.12 | Moderate effect |

---

# ✅ Main Insights

📌 Strong indicators of heart disease:
1) **Chest Pain (cp)**
2) **Max Heart Rate (thalach)**
3) **ST Depression (oldpeak)**
4) **Exercise-Induced Angina (exang)**

📌 Additional observations:
- Exercise-induced angina (exang) is less common among patients with heart disease  
- Cholesterol and blood pressure show weaker relationships  
- `ca` shows an unexpected pattern → may indicate data/coding issues  

---

# ✅ Conclusions
Several clinical measurements appear strongly connected to heart disease, including chest pain type, maximum heart rate, and ST-related metrics.  
Other features, such as cholesterol and resting blood pressure, show weaker influence.

---

# 🎬 Video Presentation
> 🔗 https://www.loom.com/share/d5891c3d0c20490ba79884fc701f4bc7

---
 
# 🧾 Files Included
| File | Description |
|------|-------------|
| Assignment_1_oded_fuchs.ipynb | Analysis & visuals |
| README.md | Project summary |
| heart.csv | Original dataset | 

---