File size: 5,887 Bytes
bb3ae08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# πŸŽ“ Student Dropout Prediction Dataset β€” EDA Assignment

> **By Tomer Bash** | Data Science Course β€” Assignment #1

---

## πŸ“Ή Presentation Video

Presentation Video link - https://youtu.be/KyafBx9W7Qg

<video src="presentation.mp4" controls="controls" style="max-width: 720px;"></video>

---

## πŸ“Œ Dataset Overview

| Property | Details |
|----------|---------|
| **Source** | Kaggle |
| **Rows** | 4,424 students |
| **Features** | 35 columns |
| **Target Variable** | `Target` β€” `Graduate`, `Enrolled`, `Dropout` |
| **Task Type** | Multi-class Classification |

The dataset contains demographic, financial, academic, and application-related information about students at a Portuguese higher education institution. The primary goal is to understand and predict **student dropout before first-year academic results are available**.

---

## 🎯 Research Goal

> **Can we predict whether a student will drop out β€” early, before first-year grades are available?**

---

## 🧹 Part 1: Data Cleaning & Preparation

- **No missing values** β€” `df.isnull().sum()` returned 0 for all columns.
- **No duplicate rows** β€” `df.duplicated().sum()` returned 0.
- All 35 features are numeric (int/float) β€” verified with `df.info()`.
- Target column contains exactly 3 classes: `Graduate`, `Enrolled`, `Dropout`.
- **Class imbalance noted:**
  - Graduate: 2,209
  - Dropout: 1,421
  - Enrolled: 794
- **Outlier detection:** Age at enrollment shows right-skewed distribution with outliers at high ages β€” identified using a boxplot.
- **Grade anomaly detected:** Significant spike at grade = 0 in 1st semester grades β€” investigated and documented below.

---

## πŸ“Š Part 2: Exploratory Data Analysis

### πŸ“ˆ Target Distribution

The dataset is imbalanced. Graduate is the majority class, followed by Dropout, and Enrolled is the smallest group. This imbalance must be handled carefully in any downstream modeling.

---

### πŸ‘€ Age at Enrollment

- Distribution is **right-skewed** β€” most students enroll young, but a long tail of older students exists.
- Boxplot reveals several **outliers at high ages** (up to ~70).
- **The Dropout group has a higher average age** than the Graduate group β€” age at enrollment is a risk factor.

| Group | Avg Age at Enrollment |
|---|---|
| Graduate | ~22 |
| Enrolled | ~23 |
| Dropout | ~26 |

---

### πŸ“š 1st Semester Grades β€” The 0-Grade Anomaly

- Grades follow a near-normal distribution overall.
- A **massive spike at grade = 0** was detected β€” far more students received exactly 0 than expected.
- Upon investigation: some students with grade = 0 **still graduated**.
- **Conclusion:** The 0-grade entries likely represent administrative records (late withdrawals, course deregistrations), not pure academic failure. This is a data quality issue to flag for modeling.
- The anomaly is **concentrated in Course 2 (Animation degree)**, though the proportion is consistent with class sizes.

---

### πŸ’° Financial Factors β€” Primary Predictor

Financial health is the strongest non-academic predictor of student outcomes.

| Financial Factor | Effect on Dropout |
|---|---|
| **Tuition fees not up to date** | Overwhelmingly **high** dropout rate |
| **Scholarship holder** | Drastically **reduces** dropout risk |
| **University debtor** | Significantly **increases** dropout risk |

> Students not keeping up with tuition fees show the single highest dropout signal in the entire dataset.

---

### ⚧ Gender

- **Female students (0)** show a slightly higher graduation rate and lower dropout rate than male students (1).
- The difference is modest but consistent across the dataset.

---

### πŸ›οΈ Application Mode

- Top 5 most common application modes were analyzed.
- **Application Mode 12 (Over 23 years old)** has the highest dropout rate β€” consistent with the age finding above.
- Standard routes (1st phase general contingent) perform best overall.

---

### πŸ”₯ Correlation Heatmap

Features analyzed: Age at enrollment, Tuition fees up to date, Scholarship holder, 1st & 2nd semester grades, GDP, Target (encoded 0=Dropout, 1=Enrolled, 2=Graduate).

**Key findings:**
- βœ… **Grades** and **financial stability** are the strongest positive predictors of graduation.
- ❌ **Age at enrollment** correlates negatively with graduation.
- πŸ“‰ **GDP** shows almost no direct linear impact β€” individual finances matter more than the macro economy.

---

## 🏁 Conclusion

### 1. πŸ’° Financial Stability β€” Primary Predictor
Scholarships drastically reduce dropout. Unpaid tuition and university debt dramatically raise it. Crucially, these signals exist **before** first-year grades are available β€” enabling early identification of at-risk students.

### 2. πŸ“š Grades & the 0-Grade Anomaly
High grades are a strong positive predictor of graduation. The spike at grade = 0 is likely administrative, not academic β€” some 0-grade students still graduated.

### 3. πŸŽ‚ Older Students Are at Higher Risk
Age at enrollment correlates negatively with graduation. Students admitted via Mode 12 ("Over 23") have the highest dropout rates β€” likely due to work and family pressures.

### 4. 🌍 Macro Economy Has No Direct Linear Effect
National GDP shows near-zero correlation with the target. Individual financial circumstances matter far more.

---

## πŸ“ Repository Contents

| File | Description |
|------|-------------|
| `dataset.csv` | The full student dataset (4,424 Γ— 35) |
| `Assignment_1_EDA_Tomer_Bash.ipynb` | Full EDA notebook with code & visualizations |
| `README.md` | This file |
| `presentation.mp4` | Video walkthrough (2–3 min) |

---

## πŸ› οΈ Technologies Used

`Python 3` Β· `pandas` Β· `numpy` Β· `matplotlib` Β· `seaborn` Β· `Jupyter Notebook`

---

*Dataset originally sourced from Kaggle. Uploaded to HuggingFace as part of Data Science Course Assignment #1.*