Case study · Regression
Supervised-learning regression toolkit
Training, comparing, and evaluating regression models for academic-performance prediction.
Problem
Predicting academic scores is useful only if you can trust the model behind the number. This toolkit implements and compares regression models on structured numerical features, with a focus on interpretable, well-evaluated results that support educational planning.
Approach
Two models — Linear Regression and Random Forest — are trained and compared under the same evaluation, so the choice between them rests on measured performance rather than assumption.
Data & inputs
Structured numerical features describing each student.
Methods & models
- Linear Regression and Random Forest
- K-fold cross-validation
- Feature-importance analysis
Results
Best model: Linear Regression · R²: 0.88 · RMSE: 2.73
Linear Regression was the most stable across validation folds, outperforming Random Forest on interpretability and generalization for this dataset.
Why it matters
Comparing models under one consistent evaluation makes model choice defensible — and a simpler, interpretable model that generalises well is often the more useful one in practice.
Tools & technologies
Figures
Selected visualizations
Feature distributions
Histograms for each input variable.
Correlation heatmap
Overview of feature correlations.
Actual vs predicted
Prediction comparison for both models.
Model evaluation
MAE, RMSE, and R² scores.
Feature importance (RF)
Random Forest importance ranking.
Coefficients (Linear)
Linear Regression coefficients.
Code & links
- GitHub repository — Jupyter notebook, evaluation metrics, and visual analysis.