1. INTRODUCTION
Academic underperformance and course failure in secondary education generate costs that extend far beyond the individual student. Unremedied failure reduces course completion rates, narrows pathways to higher education, and carries well-documented consequences for long-run employment prospects and social mobility. Despite growing awareness
The consolidation of educational data mining (EDM) and learning analytics (LA) as research disciplines has reframed this problem [8]. Student records now routinely combine demographic profiles, attendance histories, family background data, and periodic assessment results. Analysed jointly, these sources carry substantially more predictive power than any single indicator alone, and the core premise of predictive modelling in education—that academic failure is an accumulating process with detectable early signatures—has been supported repeatedly in the literature [1, 10]. The practical attraction is considerable: classifiers trained on historical records can flag students at elevated risk weeks before a formal grade is published, providing tutors and counsellors with an evidence base for targeted, pre-emptive support.
Translating this potential into reliable operational systems, however, requires settled empirical answers to several questions that the existing literature has not fully resolved for the secondary school setting. Which algorithm class performs most robustly on secondary school tabular data? Which feature categories carry the most predictive signal, and to what degree do demographic and behavioural variables contribute beyond the dominant influence of prior grades? And where precisely do socioeconomic factors sit in the predictive hierarchy, with what implications for the equity of any system built on those features?
This paper addresses those questions through a systematic comparative analysis of five widely deployed supervised classifiers applied to a benchmark secondary school dataset from Portugal [4]. Three specific contributions are made. First, a rigorous multi-metric evaluation framework is reported— covering accuracy, F1-score, AUC-ROC, and balanced accuracy simultaneously—to make class-imbalance effects explicit alongside raw correctness. Second, a dual importance analysis pairs tree-based impurity reduction with permutation importance on a held-out test set, yielding feature-ranking estimates that are robust to the inflation bias known to affect impurity measures for high-cardinality predictors. Third, the empirical findings are interpreted with explicit attention to actionability and equity, two dimensions that prior studies have addressed only briefly but that are central to any realistic institutional deployment.
2. RELATED WORK
The application of machine learning to student outcome prediction has been active for more than a decade, evolving from early classification experiments into increasingly sophisticated investigations of algorithm selection, temporal data structure, and institutional applicability.
Cortez and Silva [4] introduced the secondary school dataset used in the present study and showed that decision tree and neural network models could predict final Mathematics grades from demographic and in-term academic data. Their analysis produced two findings that subsequent research has repeatedly confirmed: first- and second-period grades are the dominant explanatory variables, and demographic or behavioural covariates retain modest but real incremental predictive value once those grades are available. Quantifying that incremental value precisely is one of the explicit objectives of the present study.
Much subsequent work has used the Open University Learning Analytics Dataset (OULAD) [8], a large collection from a distance learning institution. Waheed et al. [10] applied long short-term memory networks to OULAD data and demonstrated that deep sequential models could predict withdrawal risk well before the course midpoint, though their performance gains over simpler classifiers were modest once firstassessment results became observable, again underscoring the outsized predictive role of formal assessments. Adnan et al. [1] tested predictions at multiple temporal thresholds— from ten to one hundred per cent of course completion—and reported that Random Forest classifiers generalised more consistently than logistic regression and Naive Bayes across all observation windows, an observation that motivates the inclusion of that method here. Hlioui et al. [6] focused on the specific problem of withdrawal detection using a combination of clickstream, assessment, and demographic features, finding that pairing Bayesian classifiers with ensemble methods produced more reliable identification of withdrawal events than any single-model approach.
At the scale of individual institutions, Albriki Balabied and Eid [2] applied a Random Forest pipeline with synthetic oversampling to OULAD student data, reporting high classification accuracy for at-risk identification and demonstrating the sensitivity of accuracy estimates to class-balance management—a methodological concern that motivates the parallel reporting of balanced accuracy and AUC-ROC in the present study. Holicza and Kiss [7] compared four algorithm classes across online and offline learning environments, finding that ensemble methods consistently outperformed single classifiers regardless of modality, and that offline demographic feature sets—closely analogous to those used here— yielded higher accuracy than VLE clickstream data alone. In the higher education domain, Realinho et al. [9] published a Portuguese polytechnic dataset with three outcome classes and showed that gradient-boosted classifiers achieved the strongest macro-averaged F1 performance under balanced resampling, again supporting the ensemble advantage pattern.
Three recurring conclusions characterise this body of work. Ensemble methods outperform constituent learners on educational tabular data. Prior academic performance carries far greater predictive weight than demographic variables examined in isolation. And hybrid models that combine both feature types are preferable operationally because they retain sensitivity to students whose interim grades appear adequate but whose background characteristics place them at elevated structural risk. The present paper tests these patterns with explicit mathematical formalisation and extends interpretation to actionability and equity dimensions that prior studies have largely bypassed.
3. DATA AND METHODS
3.1 Dataset and Pre-Processing
The UCI Student Performance dataset [4] was compiled from school administrative records and questionnaires administered during the 2005–2006 academic year across two public secondary schools in the Alentejo region of Portugal. The Mathematics subset used here contains 395 student records and 33 features across four categories: academic performance (three periodic grades scored on [0,20]), behavioural variables (number of absences, weekly study time, prior course failures), socio-demographic attributes (age, sex, home address, parental education and occupation), and lifestyle factors (free time, social activity, alcohol consumption, internet access, and romantic relationship status). The dataset is publicly available under an open licence that permits unrestricted academic use; all records are fully anonymised.
A binary outcome was defined by thresholding the final grade at the Portuguese secondary pass mark:
The resulting sample is mildly imbalanced, with passing students forming the majority class. Class imbalance was addressed at the evaluation stage through balanced accuracy and AUC-ROC, rather than through resampling, to avoid inflating performance estimates. All nominal and binary categorical features were integer-label-encoded, and the full feature matrix was standardised to zero mean and unit variance prior to model fitting. A stratified 80/20 partition was applied to the full sample; all cross-validation was performed exclusively within the training partition to prevent test-set leakage.
3.2 Classifier Formulations
i=1 denote the training set, where xi ∈Rd
Let D = {(xi,yi)}n is the standardised feature vector and yi ∈{0,1} the binary outcome.
3.2.1 Logistic Regression
The conditional pass probability is modelled as P(y = 1 | x) = σ(β ⊤x + β0), where σ(·) is the logistic sigmoid. Parameters are estimated by maximising the ℓ2-regularised loglikelihood:
n ∑ i=1
[yi logPi +(1−yi)log(1−Pi)]
2 2C , C = 1.0.
3.2.2 Decision Tree
Recursive binary partitioning is performed via the CART criterion, selecting at each node t the feature–threshold pair (j∗,τ∗) that maximises the reduction in Gini impurity:

∆G(t; j,τ) = G(Qt)−|QL
G(Q) = 1−∑
Maximum tree depth was constrained to five levels to control variance.
3.2.3 Random Forest
The Random Forest [3] constructs an ensemble of B = 200 independent trees, each fitted on a bootstrap resample Db and, at every node, restricted to m = ⌊ d⌋randomly drawn candidate features. The class prediction is determined by majority vote, ˆy = mode{hb(x)}B b=1, and the calibrated probability estimate is ˆP(y = 1 | x) = B−1 ∑B b=1 ⊮[hb(x) = 1]. Feature importance is quantified by the mean decrease in node impurity
(MDI):
B ∑ b=1
MDI(j) = 1

n ∆G(t; j)
×⊮[j splits node t].
3.2.4 Gradient Boosting
The Gradient Boosting Classifier [5] builds the additive expansion
M ∑ m=1 νhm(x),
FM(x) = F0(x)+ rim = yi −σ(Fm−1(xi)), M = 200, where ν = 0.05 is the learning rate and each weak learner hm is a depth-4 regression tree fitted to the binary cross-entropy pseudo-residuals.
3.2.5 Support Vector Machine
The SVM with radial basis function kernel minimises
1 2∥w∥2 +C∑ i
