Skip to content
  • Live lab

2023 · Machine Learning · Explainable AI

Explainable Machine Learning for Performance Prediction

Built and compared Logistic Regression, Random Forest and XGBoost classifiers using preprocessing, exploratory analysis, feature engineering and k-fold cross-validation.

  • Python
  • scikit-learn
  • XGBoost
  • SHAP
  • Pandas

Headline

0.71 AUC

Logistic Regression under 5-fold cross-validation

01 · Problem

Problem

Predicting outcomes is only half the task in education analytics. The more useful question is which factors actually drive a prediction, so that anyone acting on it can see why the model said what it said.

02 · Approach

Approach

Student records were cleaned and explored, features were audited for leakage and sensitivity, and three candidate models (Logistic Regression, Random Forest, XGBoost) were compared under 5-fold stratified cross-validation. A selection rule was fixed before looking at the scores: take the best AUC, and among models within one fold-standard-deviation of it prefer the most interpretable. SHAP was then applied to the selected model to attribute each prediction to its input features.

Key concept

A near-perfect score is usually leakage

Adding the three score columns, which the target is built from, lifts cross-validated AUC from 0.713 to 0.999. The model has not learned anything about students; it has recomputed its own answer. Auditing features before training matters more than tuning after it.

Live lab

Try it

What you're looking at

Three models compared under five-fold cross-validation on a public dataset of 1,000 students, with the chosen one explained by SHAP: which features moved each prediction, and by how much. The Your data tab runs the same steps on a CSV you choose, in your browser.

Loading the lab…

03 · Results

Results

Under 5-fold cross-validation the three models were close: AUC 0.713 for Logistic Regression, 0.697 for Random Forest and 0.693 for XGBoost, all within one standard deviation of the best. Logistic Regression was both the best and the most interpretable, so it was selected. Its accuracy, 73.5%, is only 2.0 points above the 71.5% obtained by predicting nobody is at risk, so these background features carry real but limited signal. SHAP ranked lunch type, then test preparation, then parental education as the main drivers, and explained individual students in terms of how each feature moved their predicted risk.

04 · Limitations

Limitations

What it does not show

The figures on this page come from re-running the pipeline on a public dataset, not from the original coursework run. The model uses background information only, so it explains an association, not a cause. Lunch type is a socio-economic proxy and would need review before any real use. Gender and ethnicity were excluded as sensitive attributes. This is a case study: no deployment or validation on other schools is claimed.

Lessons

The strongest raw performer was not automatically the most useful model once explanation was factored in; here the interpretable baseline was as good as the flexible models. Features that were proxies for the outcome had to be audited out before training to avoid leakage.

Responsible AI

Interpretability was treated as a requirement, not an extra: a prediction is only actionable when you can say which features pushed it up or down. Sensitive attributes were excluded, the cost of excluding them was measured, and predictions are meant to prompt a conversation with an educator, never to replace one.

Data & reproducibility

Data and reproducibility

Students Performance in Exams, a public dataset: 1,000 records, no missing values. "At risk" means an average of the three scores below 60, which is 28.5% of students.

Source code is not public.

All work