Explainable machine learning for early classification of middle school student performance
Mohamed El Jihaoui, Oum El Kheir Abra, Khalifa Mansouri
Identifying students at risk of academic underperformance early is a longstanding difficulty for school systems, and the difficulty is sharpest where socioeconomic inequality is severe. This study presents an interpretable machine learning framework for predicting academic outcomes in middle school. The framework was developed on a dataset of 561,538 student records. Preprocessing, feature engineering, and stratified sampling were used to keep the sample representative across subgroups, and class imbalance was handled through class weighting during training together with threshold tuning for each outcome category. Several algorithms were compared, and model selection relied on the Borda Count method, which aggregates each model's ranking across multiple evaluation metrics instead of privileging a single criterion. CatBoost performed best on the test set, with a balanced accuracy of 88.8%, MCC of 70.6%, G-Mean of 88.7%, and F1-score of 91.4%. Explainable AI (XAI) techniques were then applied so that predictions can be interpreted at the global and individual levels. Assessment and examination scores were the strongest predictors of outcomes; poverty and class size mattered too, though less. The practical use of the framework is straightforward: making the model's reasoning visible lets educators and administrators flag at-risk students earlier and direct support to the schools and students most affected by socioeconomic disadvantages.