Assignment 3 · evaluation added in 2026
How good are the rainfall classifiers, really?
The 2023 report compared three classifiers by their errors on 41 test stations. With so few stations, one or two errors either way is noise. Here every pipeline is re-estimated by repeated cross-validation on the 150 training stations, on identical folds, so the comparisons are paired and every number comes with an interval. The original results are unchanged and still shown on the rainfall page.
- CV folds
- 10×5
- CV folds
- train stations
- 150
- train stations
- test stations
- 41
- test stations
Design
Same folds, whole pipeline refitted
Each training fold is treated as if it were the only data: standardisation, PCA or PLS and every tuning step happen inside the fold, then the held-out stations are predicted once. For the corrected pipelines nothing about the held-out stations leaks into the model. The 2023-settings logistic pipeline keeps q = 27, which was chosen in 2023 on all 150 stations; that can only favour it, so the gain from fixing it is, if anything, understated.
Folds
10 repeats of 5-fold CV, stratified by North/South (58/92). Folds for repeat r come from set.seed(90138 + r).
Nested tuning
q (1–30) is chosen by leave-one-out CV inside the training fold; m by out-of-bag error on the grid 5, 10, 19, 38, 57, 76, 96, 115, 134, 153; forests have 5,000 trees.
Paired
All seven pipelines see exactly the same folds, so differences are computed fold by fold and the shared noise cancels.
Intervals
Wilson 95% intervals for accuracies and recalls; Nadeau–Bengio corrected resampled t intervals for CV differences, with p-values Holm-adjusted within each family of comparisons; exact McNemar tests on the test set.
Accuracy
Cross-validated accuracy with 95% intervals
Mean accuracy over the 10 repeats (each repeat predicts every station once), with a Wilson interval at n = 150 stations. Green: the corrected methods; ochre: the same pipelines with the 2023 settings; grey: always predicting South.
PCA + logistic regression
- CV accuracy (95% CI)
- 94.7% (89.9–97.3%)
- Test set (95% CI)
- 40/41 (87.4–99.6%)
Repeats ranged 92.7% to 96.7%.
Random forest
- CV accuracy (95% CI)
- 92.4% (87.0–95.7%)
- Test set (95% CI)
- 38/41 (80.6–97.5%)
Repeats ranged 90.7% to 94.0%.
Tree on 50 PLS components
- CV accuracy (95% CI)
- 91.1% (85.5–94.7%)
- Test set (95% CI)
- 40/41 (87.4–99.6%)
Repeats ranged 88.7% to 92.7%.
PCA + logistic, 2023 settings
- CV accuracy (95% CI)
- 83.7% (77.0–88.8%)
- Test set (95% CI)
- 37/41 (77.5–96.1%)
Repeats ranged 78.7% to 90.7%.
Random forest, 2023 m
- CV accuracy (95% CI)
- 92.5% (87.2–95.8%)
- Test set (95% CI)
- 38/41 (80.6–97.5%)
Repeats ranged 90.7% to 94.0%.
PLS tree, 2023 test scaling
- CV accuracy (95% CI)
- 67.6% (59.8–74.6%)
- Test set (95% CI)
- 25/41 (45.7–74.3%)
Repeats ranged 59.3% to 79.3%.
Majority class (baseline)
- CV accuracy (95% CI)
- 61.3% (53.3–68.8%)
- Test set (95% CI)
- 25/41 (45.7–74.3%)
Repeats ranged 61.3% to 61.3%.
The Wilson interval at n = 150 reflects which stations happen to be in the data; the range over repeats reflects only how they are split into folds. Neither covers everything (for example, a different set of stations from the same regions), so read the intervals as a lower bound on the real uncertainty.
Paired comparisons
Which differences are real?
Accuracy differences in percentage points, fold by fold, with the corrected 95% interval. Slate: corrected method against corrected method; grey: against the majority-class baseline; ochre: the 2023 bug fixes (corrected minus as submitted). The page runs nine tests, so p-values are Holm-adjusted within each family of three: method vs method, method vs baseline and corrected vs 2023. The intervals are ordinary 95% intervals, not simultaneous ones.
PCA + logistic vs Random forest
method vs method
- CV difference (95% CI)
- +2.4 pp (−1.5 pp to +6.2 pp)
- Corrected t, then Holm-adjusted
- p = 0.219 · Holm p = 0.562
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 2 / 0, p = 0.500
PCA + logistic vs PLS tree
method vs method
- CV difference (95% CI)
- +3.6 pp (−1.8 pp to +9.1 pp)
- Corrected t, then Holm-adjusted
- p = 0.187 · Holm p = 0.562
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 0 / 0, p = 1.000
Random forest vs PLS tree
method vs method
- CV difference (95% CI)
- +1.3 pp (−3.5 pp to +6.1 pp)
- Corrected t, then Holm-adjusted
- p = 0.594 · Holm p = 0.594
- Repeats won / tied / lost
- 8 / 1 / 1
- Test: only A / only B right
- 0 / 2, p = 0.500
PCA + logistic vs Majority
method vs baseline
- CV difference (95% CI)
- +33.4 pp (+29.6 pp to +37.3 pp)
- Corrected t, then Holm-adjusted
- p < 0.001 · Holm p < 0.001
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 16 / 1, p < 0.001
Random forest vs Majority
method vs baseline
- CV difference (95% CI)
- +31.1 pp (+26.8 pp to +35.3 pp)
- Corrected t, then Holm-adjusted
- p < 0.001 · Holm p < 0.001
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 14 / 1, p < 0.001
PLS tree vs Majority
method vs baseline
- CV difference (95% CI)
- +29.8 pp (+24.4 pp to +35.1 pp)
- Corrected t, then Holm-adjusted
- p < 0.001 · Holm p < 0.001
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 16 / 1, p < 0.001
PCA + logistic vs PCA + logistic (2023)
corrected vs 2023
- CV difference (95% CI)
- +11.1 pp (+0.8 pp to +21.3 pp)
- Corrected t, then Holm-adjusted
- p = 0.035 · Holm p = 0.069
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 3 / 0, p = 0.250
Random forest vs Random forest (2023)
corrected vs 2023
- CV difference (95% CI)
- −0.1 pp (−2.4 pp to +2.2 pp)
- Corrected t, then Holm-adjusted
- p = 0.915 · Holm p = 0.915
- Repeats won / tied / lost
- 4 / 2 / 4
- Test: only A / only B right
- 0 / 0, p = 1.000
PLS tree vs PLS tree (2023)
corrected vs 2023
- CV difference (95% CI)
- +23.6 pp (+9.6 pp to +37.6 pp)
- Corrected t, then Holm-adjusted
- p = 0.001 · Holm p = 0.004
- Repeats won / tied / lost
- 10 / 0 / 0
- Test: only A / only B right
- 15 / 0, p < 0.001
m bug in the random forest changed nothing (−0.1 pp), as DR-001 explains.Errors by class
Where the mistakes are
Predictions summed over the 10 repeats, with the recall of each class (Wilson interval at the class size: 58 North, 92 South). The logistic model and the forest recognise southern stations more reliably than northern ones (the smaller class); the PLS tree is more balanced. The 2023 PLS scaling bug sends 48% of the southern stations to the wrong class.
PCA + logistic
| actual | ||
|---|---|---|
| North | South | |
| predicted North | 531 | 30 |
| predicted South | 49 | 890 |
- North recall
- 91.6% (81.6–96.4%)
- South recall
- 96.7% (90.8–98.9%)
1,500 predictions: each of the 150 stations, once per repeat.
Random forest
| actual | ||
|---|---|---|
| North | South | |
| predicted North | 509 | 43 |
| predicted South | 71 | 877 |
- North recall
- 87.8% (76.9–93.9%)
- South recall
- 95.3% (88.9–98.1%)
1,500 predictions: each of the 150 stations, once per repeat.
PLS tree
| actual | ||
|---|---|---|
| North | South | |
| predicted North | 534 | 87 |
| predicted South | 46 | 833 |
- North recall
- 92.1% (82.2–96.7%)
- South recall
- 90.5% (82.8–95.0%)
1,500 predictions: each of the 150 stations, once per repeat.
PLS tree (2023)
| actual | ||
|---|---|---|
| North | South | |
| predicted North | 537 | 443 |
| predicted South | 43 | 477 |
- North recall
- 92.6% (82.9–97.0%)
- South recall
- 51.8% (41.8–61.8%)
1,500 predictions: each of the 150 stations, once per repeat.
Out-of-bag vs cross-validation
Can the forest's own OOB error be trusted?
A random forest estimates its own error from the stations each tree did not see. Inside every outer fold, the refitted forest's OOB error (computed on the training fold only) is compared with its error on the held-out stations.
- one outer fold (≈30 held-out stations)
- one repeat (all 150 stations)
- OOB = CV
Tuning stability
How firmly are q and m determined?
The value each outer fold's own tuning picked. If tuning had found a real optimum, the choices would cluster.
- chosen in that many of the 50 outer folds
- q chosen on all 150 stations (3)
- chosen in that many of the 50 outer folds
- m chosen on all 150 stations (57)
The PLS tree split on component C1 in all 50 folds; its second split varied. Together with the flat OOB curve this says the rainfall signal is strong and low-dimensional (the summer monsoon), so the exact tuning values are weakly identified and barely affect accuracy. The highest point estimate is PCA + logistic regression at 94.7% (89.9–97.3%), but the three corrected pipelines cannot be told apart, so treat that figure as optimistic for whichever one is picked.
Reproduce
Where these numbers come from
The folds, fits and test-set predictions are produced in R by Rscript scripts/a3_evaluation.R (R version 4.6.1 (2026-06-24); randomForest 4.7.1.2, pls 2.9.0, rpart 4.1.27). It replays the 2023 and corrected fits with their original seeds and stops unless they reproduce the committed confusion matrices exactly. Only per-fold confusion counts, tuning choices, OOB estimates and test-set predictions are published (/data/rainfall-evaluation.json).
Every interval, test and summary on this page is computed from those counts by the TypeScript helpers in src/lib/stats, which are unit-tested against R (prop.test, binom.test, qt, quantile). Method notes, assumptions and limitations are on the methods page.