Skip to content

SHALINISAURAV/student-performance-predictor

Repository files navigation

🎓 Student Performance Predictor

Turning academic data points into early warnings and real support.

An end-to-end Machine Learning project that predicts student math performance using academic and demographic features — helping schools spot at-risk students before it's too late.


Python Pandas Scikit-learn Seaborn Streamlit License


🚀 Live Demo  •  📁 GitHub Repository  •  📊 EDA Notebook



📚 Table of Contents


📌 Project Overview

The Student Performance Predictor is an end-to-end Machine Learning project that predicts student math performance using academic and demographic features such as reading score, writing score, parental education level, lunch type, and test preparation course.

Behind every number in a gradebook is a story — a student who needed more support, a preparation course that made the difference, a pattern nobody noticed until it was too late. This project turns those scattered signals into a single, actionable prediction, so intervention can happen before the final exam instead of after.

This project demonstrates the complete ML workflow including:

  • 🧹 Data preprocessing
  • 🔍 Exploratory Data Analysis (EDA)
  • 🛠️ Feature engineering
  • 🤖 Model training
  • 📊 Model evaluation
  • 🔮 Prediction pipeline
  • 🌐 Streamlit deployment
  • 🗂️ GitHub version control

1️⃣ Problem Definition

🧩 Problem Statement

Students often struggle to identify whether they are academically at risk before final examinations — by the time performance dips are obvious, opportunities for intervention have often already passed.

Educational institutions and teachers require an intelligent system that can:

  • 📊 Analyze student-related factors
  • 🔮 Predict academic performance
  • 🚨 Identify low-performing students early
  • 🤝 Enable proactive academic support

The goal of this project is to build a Machine Learning model that predicts student math scores using features like:

Feature Description
📖 Reading Score Marks scored in reading
✍️ Writing Score Marks scored in writing
🧑 Gender Student gender
🎓 Parental Education Parent's education level
🍽️ Lunch Type Standard / free-reduced lunch
📚 Test Preparation Course Completed or not
🌍 Race/Ethnicity Demographic group

2️⃣ Business Understanding

💡 Why This Project Matters

This project can help:

  • 🏫 Schools identify academically weak students early
  • 👩‍🏫 Teachers provide targeted, individualized support
  • 👨‍👩‍👧 Parents monitor student progress proactively
  • 💻 Educational platforms personalize learning strategies at scale

🌍 Real-World Applications

  • 🚨 Student risk analysis
  • 📈 Academic performance monitoring
  • 🎯 Personalized education systems
  • 📊 Educational analytics dashboards

A model that predicts a score is useful. A model that predicts a score early enough to change it is transformative.


3️⃣ ML Problem Type

✅ Regression Problem

Because the target variable — Math Score — is a continuous numerical value, this is framed as a regression problem rather than classification.

The model predicts an exact numerical score, not just a category like "pass/fail."

Example

Input Features Predicted Math Score
Reading = 70, Writing = 75 72.4
Reading = 45, Writing = 50 48.1
Reading = 90, Writing = 88 89.3

4️⃣ Tech Stack

🔹 Core Technologies

Category Tools
Language Python
Data Handling Pandas, NumPy
Machine Learning Scikit-learn
Visualization Matplotlib, Seaborn
Model Persistence Joblib

🔹 Deployment

  • 🌐 Streamlit

🔹 Version Control

  • 🗂️ Git
  • 🐙 GitHub

5️⃣ Recommended Dataset

📊 Student Performance Dataset

Source: Kaggle Student Performance Dataset

The dataset contains:

  • 👤 Demographic information
  • 📚 Academic scores
  • 🎓 Education-related attributes

Main Features

Feature Description
gender Student gender
race/ethnicity Student group
parental level of education Parent education level
lunch Lunch type
test preparation course Preparation status
reading score Reading marks
writing score Writing marks
math score 🎯 Target variable

6️⃣ Final Project Architecture

student-performance-predictor/
│
├── screenshots/
│   ├── Correlation Heatmap.png
│   ├── Math Score Distribution.png
│   ├── Boxplot of Scores.png
│   └── app_ui.png
│
├── data/
│   └── raw/
│       └── StudentsPerformance.csv
│
├── notebooks/
│   └── eda.ipynb
│
├── src/
│   ├── data_preprocessing.py
│   ├── train.py
│   ├── predict.py
│   └── utils.py
│
├── app/
│   └── app.py
│
├── models/
│   └── model.pkl
│
├── requirements.txt
├── README.md
└── .gitignore

7️⃣ Exploratory Data Analysis (EDA)

EDA was performed to:

  • 📊 Understand data distribution
  • 🔍 Identify patterns
  • 🔗 Analyze feature relationships
  • 🚨 Detect outliers
  • 🧮 Study correlations

📈 Visualizations Used

Distribution Plots

  • Math score distribution
  • Reading score distribution
  • Writing score distribution

Correlation Heatmap — used to analyze feature relationships

Boxplots — used to identify score spread and outliers

Countplots — used for categorical feature analysis


8️⃣ Sample EDA Graphs

📊 Correlation Heatmap

Correlation Heatmap

Reveals how strongly reading and writing scores correlate with math performance — a key insight driving feature selection.


📈 Math Score Distribution

Math Score Distribution

Shows the overall spread of math scores across the student population.


📉 Boxplot Analysis

Boxplot Analysis

Highlights score spread and flags potential outliers across subjects.


9️⃣ Data Preprocessing

The following preprocessing steps were applied:

  • 🏷️ Handling categorical variables
  • 🔢 Label Encoding
  • 🎯 Feature selection
  • ✂️ Train-test splitting

Train-Test Split

Split Percentage
🏋️ Training Data 80%
🧪 Testing Data 20%

🔟 Model Building

🤖 Model Used: Linear Regression

Linear Regression was used as the baseline model for predicting student scores — chosen for its interpretability, speed, and effectiveness as a first benchmark before exploring more complex models.


1️⃣1️⃣ Model Evaluation

The model was evaluated using:

  • 📏 Mean Absolute Error (MAE)
  • 📐 Mean Squared Error (MSE)
  • 📊 R² Score

Evaluation Metrics

Metric Purpose
MAE Average prediction error
MSE Squared prediction error (penalizes larger errors)
R² Score Overall model accuracy / goodness of fit

1️⃣2️⃣ Streamlit Web Application

An interactive Streamlit web app was built where users can:

  • ✍️ Enter student details
  • 🔮 Predict math score
  • 🏷️ View performance category

Features

  • 🎨 User-friendly UI
  • ⚡ Real-time prediction
  • 🏷️ Performance categorization (e.g., At Risk / Average / High Performer)

1️⃣3️⃣ Live Deployment

🚀 Streamlit Deployment Link

https://your-streamlit-app-link.streamlit.app

🔧 Replace this placeholder with your actual deployed Streamlit app URL once live.


1️⃣4️⃣ Installation Guide

Clone Repository

git clone YOUR_GITHUB_REPOSITORY_LINK

Move Into Project Folder

cd student-performance-predictor

Create Virtual Environment

Mac/Linux

python3 -m venv venv
source venv/bin/activate

Windows

python -m venv venv
venv\Scripts\activate

Install Dependencies

pip install -r requirements.txt

1️⃣5️⃣ Run Model Training

python src/train.py

1️⃣6️⃣ Run Streamlit App

streamlit run app/app.py

1️⃣7️⃣ Future Improvements

  • 🌲 Random Forest Regressor
  • ⚡ XGBoost Regressor
  • 🎛️ Hyperparameter tuning
  • 🎨 Better UI/UX
  • 📊 Model comparison dashboard
  • 🔍 Feature importance visualization
  • 📦 MLflow integration
  • 🐳 Docker deployment
  • ⚙️ FastAPI backend
  • 🔄 CI/CD pipeline

1️⃣8️⃣ Learning Outcomes

This project helped in understanding:

  • 🔄 End-to-end Machine Learning workflow
  • 🔍 EDA and visualization
  • 🧹 Data preprocessing
  • 🛠️ Feature engineering
  • 📈 Regression modeling
  • 📊 Model evaluation
  • 🌐 Streamlit deployment
  • 🗂️ GitHub workflow
  • 🏗️ ML project structuring

1️⃣9️⃣ Screenshots

🖥️ Streamlit App UI

Streamlit App UI


2️⃣0️⃣ Author

👩‍💻 Shalini Saurav

BTech CSE (Data Science) Student

Passionate about:

🤖 Artificial Intelligence  •  📊 Machine Learning  •  🔬 Data Science  •  ✨ Generative AI  •  🚀 Entrepreneurship


⭐ If you found this project useful, consider giving it a star on GitHub!

Every star helps more students benefit from proactive academic support.

About

A Machine Learning project that predicts student math performance using features like reading score, writing score, parental education, lunch type, and test preparation course. Built with Python, Scikit-learn, Pandas, and Streamlit, featuring data preprocessing, model training, evaluation, and an interactive web app.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors