Skip to content

VaidehiDeore/Student-Performance-Prediction-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ“ Student Performance Prediction System

An end-to-end Machine Learning + Full Stack project that predicts a student's academic performance using semester-long data such as attendance, study hours, quiz scores, assignments, and engagement.

This system provides:

  • ๐Ÿ“Š Performance prediction (Grade Aโ€“F)
  • โš ๏ธ Risk level detection (Low / Medium / High)
  • ๐Ÿ’ก Personalized intervention suggestions
  • ๐ŸŒ FastAPI backend for real-time prediction
  • ๐ŸŽจ Premium Next.js dashboard for visualization

๐Ÿ“Œ Objective

To build an intelligent system that helps educational institutions:

  • Identify weak students early
  • Improve academic performance
  • Enable personalized learning
  • Prevent dropouts using data-driven insights

๐Ÿง  How the System Works

Student Input Data
        โ†“
Data Preprocessing
        โ†“
Feature Engineering
        โ†“
Machine Learning Model (XGBoost)
        โ†“
FastAPI Backend (Prediction API)
        โ†“
Next.js Dashboard (UI)
        โ†“
Grade + Risk + Intervention Output

๐Ÿงช Dataset & Simulation

Since real academic data is sensitive, this project uses synthetic data generation.

๐Ÿ”น How Simulation Works:

  • Random but realistic student data is generated

  • Academic patterns are simulated:

    • High attendance โ†’ better scores
    • Low study hours โ†’ lower performance
  • Target variable (grade_band) is assigned based on performance rules

Features Used:

  • Gender
  • Attendance (%)
  • Study hours per week
  • Quiz average
  • Assignment score
  • Midterm score
  • LMS logins
  • Forum posts
  • Previous GPA
  • Sleep hours
  • Internet access
  • Parent education

๐Ÿค– Machine Learning Model

Model Used:

XGBoost Classifier

Why XGBoost?

  • Works well on structured/tabular data
  • Handles non-linear relationships
  • High accuracy and performance
  • Industry-level model

๐Ÿ“Š Model Output

Example API Response:

{
  "predicted_grade": "A",
  "confidence": 74.49,
  "risk_level": "Low Risk",
  "alert": "Student is on track.",
  "intervention": "Maintain current learning plan."
}

๐Ÿ“‚ Folder Structure

Student-Performance-Prediction-System/
โ”‚
โ”œโ”€โ”€ app/                     # FastAPI backend
โ”‚   โ””โ”€โ”€ main.py
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                 # Generated dataset
โ”‚   โ””โ”€โ”€ processed/
โ”‚
โ”œโ”€โ”€ dashboard/              # Next.js frontend
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ globals.css
โ”‚   โ””โ”€โ”€ package.json
โ”‚
โ”œโ”€โ”€ models/                 # Saved ML models
โ”‚   โ”œโ”€โ”€ model.pkl
โ”‚   โ””โ”€โ”€ encoder.pkl
โ”‚
โ”œโ”€โ”€ src/                    # ML pipeline
โ”‚   โ”œโ”€โ”€ generate_data.py
โ”‚   โ”œโ”€โ”€ train.py
โ”‚   โ”œโ”€โ”€ predict.py
โ”‚   โ”œโ”€โ”€ preprocess.py
โ”‚   โ””โ”€โ”€ evaluate.py
โ”‚
โ”œโ”€โ”€ outputs/                # Reports
โ”‚
โ”œโ”€โ”€ images/                 # Screenshots
โ”‚
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ main.py

โš™๏ธ Setup & Installation

1๏ธโƒฃ Clone Repository

git clone https://github.com/VaidehiDeore/Student-Performance-Prediction-System.git
cd Student-Performance-Prediction-System

2๏ธโƒฃ Create Virtual Environment

python -m venv venv

Activate:

venv\Scripts\activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

โš ๏ธ Fix Memory Issue (Windows)

$env:OPENBLAS_NUM_THREADS="1"
$env:OMP_NUM_THREADS="1"
$env:MKL_NUM_THREADS="1"
$env:NUMEXPR_NUM_THREADS="1"

๐Ÿš€ Run Full Pipeline

Step 1 โ€” Generate Dataset

python src/generate_data.py

Step 2 โ€” Train Model

python src/train.py

Step 3 โ€” Test Prediction

python src/predict.py

๐ŸŒ Run Backend (FastAPI)

uvicorn app.main:app --reload

Open:

http://127.0.0.1:8000/docs

๐ŸŽจ Run Frontend (Dashboard)

cd dashboard
npm install
npm run dev

Open:

http://localhost:3000

๐Ÿ–ฅ๏ธ Dashboard Features

  • ๐Ÿ“Š Performance bar graph
  • ๐ŸŽฏ Circular academic metrics
  • ๐Ÿ“ฅ Dynamic input form
  • ๐Ÿ“ˆ Prediction result panel
  • โš ๏ธ Risk level visualization
  • ๐Ÿ’ก Intervention suggestions

๐Ÿ“ธ Screenshots

Full Dashboard

Full Dashboard

Input Form

Input Form

Performance Graph

Performance Graph

Prediction Result

Prediction Result

API Docs

API Docs


๐Ÿ“Š Key Insights

  • Attendance strongly impacts performance
  • Study hours correlate with higher grades
  • LMS engagement improves outcomes
  • Low engagement โ†’ higher risk

๐Ÿง  Key Learnings

  • Building end-to-end ML systems
  • Data simulation techniques
  • Feature engineering
  • XGBoost model training
  • FastAPI backend development
  • Next.js frontend integration
  • Dashboard UI design
  • GitHub project structuring

๐Ÿ”ฎ Future Improvements

  • CSV upload for batch predictions
  • SHAP model explainability
  • User login system
  • Database integration
  • Deployment (AWS / Vercel)
  • Model monitoring

๐Ÿ‘ฉโ€๐Ÿ’ป Author

Vaidehi Deore Second Year Engineering Student


โญ Project Status

Completed End-to-End:
Dataset โ†’ ML Model โ†’ FastAPI โ†’ Next.js Dashboard โ†’ Prediction Output

About

End-to-end machine learning system that predicts student performance using academic and engagement data, with FastAPI backend and Next.js dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors