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

Python Scikit-learn Plotly

Figures

Selected visualizations

Feature distributions

Histograms for each input variable.

Feature distributions chart

Correlation heatmap

Overview of feature correlations.

Correlation heatmap

Actual vs predicted

Prediction comparison for both models.

Scatter plots of predictions

Model evaluation

MAE, RMSE, and R² scores.

Evaluation metrics table

Feature importance (RF)

Random Forest importance ranking.

Feature importance for Random Forest

Coefficients (Linear)

Linear Regression coefficients.

Feature coefficients for Linear Regression

Code & links