Three classifiers from MAST90138 Assignment 3 (University of Melbourne, 2023 Semester 2), re-run and re-evaluated in 2026. Each one labels an Australian weather station as North (0) or South (1) from its average rainfall on each of the 365 days of the year.
Model details
| Aspect | PCA + logistic regression | Random forest | Tree on PLS components |
|---|---|---|---|
| Pipeline | standardise, PCA, logistic regression on the first q components | randomForest, B = 5,000 trees on all 365 days | standardise, kernel PLS (50 components), rpart tree on the scores |
| Tuning | q in 1..30 by leave-one-out CV (q = 3 on all 150 stations) | m by out-of-bag error on a 10-value grid (m = 57 on all 150 stations) | rpart defaults; the tree splits on C1 and C2 |
| Software | R 4.6, glm; TypeScript port of glm.fit in the browser | R 4.6, randomForest 4.7-1.2 | R 4.6, pls 2.9.0, rpart 4.1.27; TypeScript port in the browser |
| Seed | n/a (deterministic) | set.seed(90138) | set.seed(90138) |
Author: Sunchuangyu (Rin) Huang. The 2023 versions contained bugs that are documented, not hidden: see the errata on the site and DR-001. This card describes the corrected pipelines unless stated otherwise.
Intended use
- Teaching and portfolio demonstration of high-dimensional classification (p = 365 predictors, n = 150 stations): dimension reduction before classification, honest model comparison, and how small preprocessing slips change results.
- Exploring, in the browser, how the choice of q, the PLS test scaling or the tuning loop affects the answer.
Out-of-scope uses
- Operational climate or weather classification of real stations. The models were never validated outside this course data set and its time period.
- Any decision about people. The data describe places; nothing here is suitable for decisions about individuals.
Training data
- 150 stations (58 North, 92 South), each a vector of 365 daily average rainfall values with a North/South label. Supplied with the subject; redistribution terms unknown, so the website publishes only derived quantities (DR-003).
- Test data: 41 further stations (16 North, 25 South), used once per model.
- Preprocessing: each day standardised with the training means and SDs (PCA and PLS pipelines); the random forest uses raw values.
Evaluation
Repeated stratified cross-validation on the 150 training stations (10 repeats x 5 folds, every tuning step of the corrected pipelines nested inside the training fold, identical folds for every pipeline), plus the 41-station test set. Accuracies are means over repeats with Wilson 95% intervals at n = 150; test accuracies have Wilson intervals at n = 41. Produced by scripts/a3_evaluation.R; intervals computed in web/src/lib/rainfall-evaluation.ts.
| Pipeline | CV accuracy (95% CI) | Test accuracy (95% CI) | North recall in CV | South recall in CV |
|---|---|---|---|---|
| PCA + logistic regression | 94.7% (89.9–97.3%) | 40/41, 97.6% (87.4–99.6%) | 91.6% (81.6–96.4%) | 96.7% (90.8–98.9%) |
| Random forest | 92.4% (87.0–95.7%) | 38/41, 92.7% (80.6–97.5%) | 87.8% (76.9–93.9%) | 95.3% (88.9–98.1%) |
| Tree on PLS components | 91.1% (85.5–94.7%) | 40/41, 97.6% (87.4–99.6%) | 92.1% (82.2–96.7%) | 90.5% (82.8–95.0%) |
| Majority class (always South) | 61.3% (53.3–68.8%) | 25/41, 61.0% (45.7–74.3%) | 0.0% | 100.0% |
Paired comparisons (Nadeau–Bengio corrected resampled t on the per-fold accuracy differences; nine tests in three families of three, so p-values are Holm-adjusted within each family):
- Every method beats the majority baseline by about 30 percentage points (all corrected intervals exclude zero).
- The three methods cannot be told apart: PCA + logistic minus random forest is +2.4 percentage points (95% CI −1.5 to +6.2), PCA + logistic minus PLS tree +3.6 (−1.8 to +9.1), random forest minus PLS tree +1.3 (−3.5 to +6.1). On the test set they disagree on at most two stations (exact McNemar p ≥ 0.5).
- The 2023 bugs: fixing the PLS test scaling adds +23.6 percentage points (+9.6 to +37.6), Holm-adjusted p = 0.004, a clear effect. Fixing the logistic pipeline's settings points the same way, +11.1 (+0.8 to +21.3), but does not survive the adjustment for testing three fixes (Holm p = 0.069; on the test set the exact McNemar test is 3 stations to 0, p = 0.250), so it is suggestive rather than established. The 2023-settings logistic pipeline keeps q = 27, which was chosen in 2023 on all 150 stations, so its CV accuracy carries a small leak that can only favour it; the gain from the fix is, if anything, understated. Fixing the random forest's m loop changes nothing (−0.1, −2.4 to +2.2).
The random forest's own out-of-bag error (6.7%, 95% CI 3.7–11.8%) agrees with its repeated-CV error (7.6%, 4.3–13.0%) and its test error (7.3%, 2.5–19.4%).
Known failure modes
- Northern stations are the harder class for the logistic model and the forest (recall about 88–92% against 95–97% for the South). North is also the smaller class (58 of 150).
- Preprocessing mismatches are catastrophic. Projecting unstandardised test rows onto PLS directions learned from standardised data (the 2023 slip) drops CV accuracy to 67.6% and South recall to about 52%. Any new data must be standardised with the training means and SDs.
- Tuning is weakly identified. Inside the 50 outer folds, q ranged from 2 to 9 and m from 5 to 153; the OOB error curve is nearly flat. The specific values q = 3 and m = 57 should not be read as meaningful optima.
- Small test set. With 41 stations, a single error moves test accuracy by 2.4 percentage points; test-set intervals are 12 to 29 points wide.
- Distribution shift. The curves are long-run averages for one period. Stations in transition zones, different years, or a changing climate may not look like the training data.
Ethical considerations
- No personal data: the observations are weather stations. The main data concern is licensing of the course-supplied files, handled by publishing derived quantities only. A disclosure check shows the published PLS projections still allow an approximate reconstruction of the standardised training curves; this is recorded in DR-003 as an open decision.
- Low stakes, high temptation to over-claim: a 41-station test set can make a model look perfect. This card reports cross-validated intervals and paired comparisons so the methods are not ranked on noise.
- The optional AI feature on the site does not touch these models or their data.
Caveats and recommendations
- Treat the three pipelines as equally good on this data; prefer the simplest (PCA + logistic regression on a few components) if one must be chosen, and say that the choice is not statistically supported.
- Re-estimate with fresh stations before drawing conclusions about other regions or periods.
Data card: wheat kernels (Assignment 1)
- Source: UCI Machine Learning Repository "seeds" (Charytanowicz et al., 2010), CC BY 4.0. 210 kernels, 70 each of Kama, Rosa and Canadian wheat, 7 geometric measurements from soft X-ray images.
- Use on the site: principal component analysis in the browser, with bootstrap intervals and parallel analysis (DR-002). No model is trained to predict variety.
- Limitations: one harvest and one laboratory; measurements on very different scales (mm² to dimensionless), which drives the covariance PCA.