# Student Performance Factors β EDA Project
## 1. Project Overview
This project is part of **Assignment #1 β EDA & Dataset**.
The goal is to practice end-to-end Exploratory Data Analysis (EDA) on a real-world style dataset, upload the work to Hugging Face, and present the main insights in a short video.
I chose a dataset about **student performance** and tried to answer the question:
> **What are the key factors that influence a student's final exam score?**
> Which features are most strongly associated with higher or lower exam results?
---
## 2. Dataset Description
- **Source:** Kaggle β *Student Performance Factors* dataset
- **File:** `StudentPerformanceFactors.csv`
- **Rows:** 6,607 students
- **Columns:** 20 features (mixed numeric + categorical)
### Main Features
- **Study & performance**
- `Hours_Studied` β hours studied per week
- `Attendance` β % of classes attended
- `Previous_Scores` β score in previous exams
- `Tutoring_Sessions` β tutoring sessions per month
- `Exam_Score` β **final exam score (target)**
- **Lifestyle**
- `Sleep_Hours` β hours of sleep per night
- `Physical_Activity` β hours of physical activity per week
- **Context & background**
- `Parental_Involvement` (Low / Medium / High)
- `Access_to_Resources` (Low / Medium / High)
- `Family_Income` (Low / Medium / High)
- `Motivation_Level` (Low / Medium / High)
- `Teacher_Quality` (Low / Medium / High)
- `School_Type` (Public / Private)
- `Parental_Education_Level`
- `Distance_from_Home` (Near / Moderate / Far)
- `Gender` (Male / Female), and more.
### Target Variable
- **`Exam_Score`** β numeric continuous score.
- The task is formulated as a **regression** problem: explaining and predicting the final exam score.
---
## 3. Files in this Dataset
- `StudentPerformanceFactors.csv` β original dataset file.
- `Copy_of_Assignment_1_EDA_and_Dataset.ipynb` β Google Colab notebook with the full EDA.
- `README.md` β this summary file.
- (Optional) Exported plot images for key visualizations.
---
## 4. EDA Workflow
All steps below are implemented and documented in the notebook.
### 4.1 Data Loading & Initial Preview
- Loaded the CSV using `pandas.read_csv`.
- Used `df.head()` to preview the first rows and verify that:
- The file is read correctly.
- The target column `Exam_Score` exists and is numeric.
- There is a mix of numeric and categorical features.
### 4.2 Dataset Structure β `df.info()`
- **Rows:** 6,607
- **Columns:** 20
- **Types:** 7 numeric (`int64`), 13 categorical (`object`).
Columns with missing values:
- `Teacher_Quality` β 78 missing
- `Parental_Education_Level` β 90 missing
- `Distance_from_Home` β 67 missing
All other columns are complete.
**Decision:**
Because the percentage of missing values is very small (< 1.5%) and all three are categorical, the recommended treatment is to **fill missing values with the mode** of each column.
This keeps all rows and avoids unnecessary data loss.
### 4.3 Duplicate Rows
- Command: `df.duplicated().sum()`
- Result: **0 duplicates**
- β
No rows needed to be removed.
### 4.4 Outlier Detection
- Used **boxplots** for numeric features:
- `Hours_Studied`
- `Sleep_Hours`
- `Previous_Scores`
- `Tutoring_Sessions`
- `Physical_Activity`
- `Attendance`
- Found some outliers in:
- `Hours_Studied` (very high study hours for a few students)
- `Tutoring_Sessions` (up to 8 sessions)
- `Physical_Activity`
**Decision:**
All outliers appear realistic and consistent with real-life behavior, so **no rows were removed**.
Outliers are treated as natural variation rather than data errors.
### 4.5 Descriptive Statistics β `df.describe()`
Key numeric insights:
- **Hours_Studied**
- Mean β 20 hours/week, range 1β44.
- **Attendance**
- Mean β 80%, range 60β100%.
- **Sleep_Hours**
- Mean β 7 hours/night, range 4β10.
- **Previous_Scores**
- Mean β 75, range 50β100.
- **Physical_Activity**
- Mean β 3 hours/week, range 0β6.
- **Exam_Score (target)**
- Mean β 67.2, median 67, range 55β101.
- Distribution is fairly symmetric.
No numeric feature shows impossible values.
### 4.6 Correlation Analysis β Heatmap (numeric only)
A correlation heatmap was created using only numeric columns.
Main numerical correlations with `Exam_Score`:
- **Attendance:** strong positive correlation (~0.58)
- **Hours_Studied:** moderate positive correlation (~0.45)
- **Previous_Scores:** weak positive correlation (~0.18)
- **Tutoring_Sessions:** weak positive correlation (~0.16)
- **Sleep_Hours:** almost no correlation (~β0.02)
- **Physical_Activity:** almost no correlation (~0.03)
β‘οΈ **Conclusion:**
Attendance and study habits are the most important numeric predictors of exam performance.
---
## 5. Key Questions & Visual Insights
In this section, I formulated specific questions and answered them using plots.
### Q1: Does attendance affect exam performance?
- **Plot:** Scatter plot + regression line
*(Attendance vs Exam_Score)*
**Insight:**
There is a **clear positive relationship** between attendance and exam scores.
Students with higher attendance tend to achieve higher scores, and the regression line shows a strong upward trend.
Attendance is the **strongest numeric predictor** of exam performance in this dataset.
---
### Q2: Do more study hours lead to higher exam scores?
- **Plot:** Scatter plot + regression line
*(Hours_Studied vs Exam_Score)*
**Insight:**
There is a **moderate positive relationship** between hours studied and exam score.
Students who study more hours per week generally achieve better exam results.
The correlation (~0.45) indicates that increasing study time is associated with better performance, although not as strongly as attendance.
---
### Q3: How important are previous scores?
- **Plot:** Scatter plot + regression line
*(Previous_Scores vs Exam_Score)*
**Insight:**
There is only a **weak positive trend**.
Students with higher previous scores tend to do slightly better on the final exam, but the correlation (~0.18) is small.
Past performance has **limited predictive power** compared to attendance and study hours.
---
### Q4: Do more tutoring sessions improve exam scores?
- **Plot:** Boxplot
*(Tutoring_Sessions vs Exam_Score)*
**Insight:**
Students who attend more tutoring sessions show **slightly higher median scores**, especially around 5β7 sessions.
However, the distributions overlap heavily, and the effect is small, matching the weak correlation (~0.16).
Tutoring helps a bit, but it is **not a major driver** of performance.
---
### Q5: Are there score differences between genders?
- **Plot:** Boxplot
*(Gender vs Exam_Score)*
**Insight:**
Male and female students have **very similar exam score distributions** with almost identical medians.
There is **no meaningful difference** in performance by gender in this dataset.
---
### Q6: Does sleep duration influence exam performance?
- **Plot:** Scatter plot + regression line
*(Sleep_Hours vs Exam_Score)*
**Insight:**
There is **no strong relationship** between sleep hours and exam score.
The regression line is almost flat and the correlation (~β0.02) is near zero.
Within the observed range of 4β10 hours, sleep duration does **not significantly impact** exam performance in a linear way.
---
### Q7: Does physical activity affect exam scores?
- **Plot:** Scatter plot + regression line
*(Physical_Activity vs Exam_Score)*
**Insight:**
Physical activity shows **almost no correlation** with exam scores (~0.03).
While exercise is beneficial for health, it does not directly predict academic performance here.
---
### Q8: How does motivation level relate to exam scores?
- **Plot:** Boxplot
*(Motivation_Level vs Exam_Score)*
**Insight:**
There is a **clear positive pattern**:
Students with higher motivation levels (High) tend to have **higher median scores** than those with Medium or Low motivation.
This indicates that **motivation is an important categorical factor** affecting success, even though it does not appear in the numerical correlation matrix.
---
### Q9: Is there a gap in performance between income levels?
- **Plot:** Boxplot
*(Family_Income vs Exam_Score)*
**Insight:**
There are **small but visible differences** between income groups.
Students from Medium and High income families have slightly higher median scores than those from Low income families, but the distributions overlap a lot.
Family income may have **some positive effect**, but it is not a dominant factor compared to attendance and study habits.
---
## 6. Main Conclusions
1. **Attendance** is the strongest predictor of exam performance.
Students who attend more classes achieve significantly higher scores.
2. **Study hours** are also important.
Consistently studying more hours per week is associated with better results.
3. **Previous scores** and **tutoring sessions** have weak but positive effects.
4. **Sleep** and **physical activity** show almost **no linear relationship** with exam scores in this dataset.
5. **Motivation level** and, to a lesser extent, **family income** influence performance when comparing groups, even though they are categorical.
Overall, the dataset suggests that **engagement with studies** (attendance, hours studied, motivation) matters much more than background factors like income or gender.
---
## 7. How to Run the Notebook
1. Open the notebook file from this dataset on Hugging Face or in Google Colab.
2. Make sure `StudentPerformanceFactors.csv` is in the same directory or update the file path.
3. Run all cells from top to bottom to reproduce:
- Data loading and cleaning
- Descriptive statistics
- Correlation heatmap
- All visualizations and insights
---
## 8. Video Presentation
A short **2β3 minute video** explaining this project, the dataset, and the main EDA insights is available here:
π **Video link:** _PLACE_YOUR_VIDEO_LINK_HERE_
The video includes:
- A quick to