Skip to content

This is a Streamlit web application that predicts a student's writing score based on their math and reading scores using a Linear Regression model trained on the Students Performance Dataset. πŸ’‘ Assumption: If a student performs well in math and reading, they will likely perform similarly in writing.

Notifications You must be signed in to change notification settings

MansoobeZahra/Student_score_Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Student Writing Score Predictor

This is a Streamlit web application that predicts a student's writing score based on their math and reading scores using a Linear Regression model trained on the Students Performance Dataset.

Assumption: If a student performs well in math and reading, they will likely perform similarly in writing.

Live Demo

πŸ”— Launch App on Streamlit https://studentscorepredictor-83dblgddhbjzylyez8sgoe.streamlit.app/

Features

  • Predict Writing Score from Math and Reading Scores

  • Shows Model Accuracy (RΒ² Score) after prediction

  • Clean UI with interactive sliders

  • Uses Linear Regression for continuous prediction

  • Model is saved using pickle and re-used in production

  • Built with Streamlit, scikit-learn, pandas, NumPy, Matplotlib

Project Structure

student-score-app/
β”œβ”€β”€ app.py                  ← Streamlit app
β”œβ”€β”€ train_model.py          ← One-time training script
β”œβ”€β”€ StudentsPerformance.csv ← Dataset
β”œβ”€β”€ model.pkl               ← Pickled trained model
β”œβ”€β”€ X_test.pkl              ← Test data for accuracy display
β”œβ”€β”€ y_test.pkl
β”œβ”€β”€ requirements.txt        ← Python dependencies
└── README.md               ← You are here

How It Works

1. Dataset

Based on the StudentsPerformance.csv dataset containing:

  • Categorical: gender, race/ethnicity, parental education, lunch, test preparation

  • Numerical: math, reading, writing scores

2. Model Assumption

We assume writing score depends mostly on math and reading scores. So:

  • Features: math_score, reading_score

  • Target: writing_score

3. Model Training (train_model.py)

  • Encodes categorical variables

  • Normalizes numerical features

  • Trains a LinearRegression model

  • Saves:

    • model.pkl

    • X_test.pkl, y_test.pkl (for calculating RΒ² in production)

4. Streamlit App (app.py)

  • Loads model and test data

  • Takes input using sliders

  • Predicts writing score

  • Displays model performance (RΒ² Score)

Example

_image _

Installation & Run Locally

git clone  https://github.com/MansoobeZahra/Student_score_Predictor.git
cd student-score-app
pip install -r requirements.txt

# First: run training script
python train_model.py

# Then: run Streamlit app
streamlit run app.py

Requirements

pandas
numpy
scikit-learn
streamlit

Author

Mansoob E Zehra | Pakistan | Computer Science Student| GitHub

License

This project is open-source and available under the MIT License.

About

This is a Streamlit web application that predicts a student's writing score based on their math and reading scores using a Linear Regression model trained on the Students Performance Dataset. πŸ’‘ Assumption: If a student performs well in math and reading, they will likely perform similarly in writing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages