A beginner-friendly Machine Learning project built with Python, Scikit-learn, and Streamlit that predicts a student's exam score based on study habits and academic performance.
The model uses Linear Regression to estimate the final score using the following inputs:
- 📚 Hours Studied
- ✅ Attendance Percentage
- 📝 Previous Exam Score
- 😴 Sleep Hours
This project demonstrates the complete machine learning workflow, from data preparation and model training to prediction, visualization, and a simple web interface.
- Predicts student exam scores using Linear Regression
- Input validation to prevent invalid values
- Model evaluation using R² Score and Mean Squared Error (MSE)
- Scatter plot comparing actual vs. predicted scores
- Saves the trained model using Joblib
- Command-line prediction using
argparse - Interactive web application built with Streamlit
- Clean and beginner-friendly project structure
- Python 3
- Pandas
- Scikit-learn
- Matplotlib
- Joblib
- Streamlit
- VS Code
- Git & GitHub
student-score-predictor/
│
├── data/
│ └── student_scores.csv
├── train.py
├── predict.py
├── app.py
├── student_model.pkl
├── actual_vs_predicted.png
├── requirements.txt
├── README.md
└── .gitignore
Clone the repository:
git clone https://github.com/Hasu0507/student-score-predictor.gitGo to the project directory:
cd student-score-predictorInstall dependencies:
pip install -r requirements.txtpython train.pypython predict.py --hours 6 --attendance 85 --previous 75 --sleep 7streamlit run app.pyCommand-line
Predicted Score: 79.21
Training
R² Score: 0.98
Mean Squared Error: 2.10
Model saved successfully.
- Load the dataset.
- Preprocess the data.
- Split into training and testing datasets.
- Train a Linear Regression model.
- Evaluate model performance.
- Save the trained model.
- Predict new student scores.
- Visualize model predictions.
- Deploy a simple web interface with Streamlit.
Sreekamali J
GitHub: https://github.com/hasu0507