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.
- Project Overview
- Problem Definition
- Business Understanding
- ML Problem Type
- Tech Stack
- Recommended Dataset
- Project Architecture
- Exploratory Data Analysis
- Sample EDA Graphs
- Data Preprocessing
- Model Building
- Model Evaluation
- Streamlit Web Application
- Live Deployment
- Installation Guide
- Run Model Training
- Run Streamlit App
- Future Improvements
- Learning Outcomes
- Screenshots
- Author
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
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 |
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
- 🚨 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.
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."
| Input Features | Predicted Math Score |
|---|---|
| Reading = 70, Writing = 75 | 72.4 |
| Reading = 45, Writing = 50 | 48.1 |
| Reading = 90, Writing = 88 | 89.3 |
| Category | Tools |
|---|---|
| Language | Python |
| Data Handling | Pandas, NumPy |
| Machine Learning | Scikit-learn |
| Visualization | Matplotlib, Seaborn |
| Model Persistence | Joblib |
- 🌐 Streamlit
- 🗂️ Git
- 🐙 GitHub
Source: Kaggle Student Performance Dataset
The dataset contains:
- 👤 Demographic information
- 📚 Academic scores
- 🎓 Education-related attributes
| 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 |
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
EDA was performed to:
- 📊 Understand data distribution
- 🔍 Identify patterns
- 🔗 Analyze feature relationships
- 🚨 Detect outliers
- 🧮 Study correlations
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
Reveals how strongly reading and writing scores correlate with math performance — a key insight driving feature selection.
Shows the overall spread of math scores across the student population.
Highlights score spread and flags potential outliers across subjects.
The following preprocessing steps were applied:
- 🏷️ Handling categorical variables
- 🔢 Label Encoding
- 🎯 Feature selection
- ✂️ Train-test splitting
| Split | Percentage |
|---|---|
| 🏋️ Training Data | 80% |
| 🧪 Testing Data | 20% |
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.
The model was evaluated using:
- 📏 Mean Absolute Error (MAE)
- 📐 Mean Squared Error (MSE)
- 📊 R² Score
| Metric | Purpose |
|---|---|
| MAE | Average prediction error |
| MSE | Squared prediction error (penalizes larger errors) |
| R² Score | Overall model accuracy / goodness of fit |
An interactive Streamlit web app was built where users can:
- ✍️ Enter student details
- 🔮 Predict math score
- 🏷️ View performance category
- 🎨 User-friendly UI
- ⚡ Real-time prediction
- 🏷️ Performance categorization (e.g., At Risk / Average / High Performer)
https://your-streamlit-app-link.streamlit.app
🔧 Replace this placeholder with your actual deployed Streamlit app URL once live.
git clone YOUR_GITHUB_REPOSITORY_LINKcd student-performance-predictorMac/Linux
python3 -m venv venv
source venv/bin/activateWindows
python -m venv venv
venv\Scripts\activatepip install -r requirements.txtpython src/train.pystreamlit run app/app.py- 🌲 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
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
BTech CSE (Data Science) Student
Passionate about:
🤖 Artificial Intelligence • 📊 Machine Learning • 🔬 Data Science • ✨ Generative AI • 🚀 Entrepreneurship



