Skip to content

7/8 All assays in a crossValidate call share the same folds (changes results; decision) - #132

Merged
DarioS merged 3 commits into
review/6-fasterfrom
review/7-shared-folds
Oct 28, 2026
Merged

DarioS merged 3 commits into
review/6-fasterfrom
review/7-shared-folds

Conversation

@ellispatrick

@ellispatrick ellispatrick commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Part of a stack of 8 pull requests from the October 2026 audit of ClassifyR (AUDIT.md on branch audit-2026-10). Each part is based on the one before, so they need to be merged in order. Each one can be accepted, changed or rejected on its own merits. Draft PR #125 holds all eight together. Every part installs and passes its own tests.

Stack, merge in order: #126 tests and core fixes → #127 interface fixes → #128 metrics and plots → #129 pathways and criss-cross → #130 maintenance → #131 faster cross-validation (identical results) → #132 shared folds (changes results) → #133 release notes. The regression harness and timings are in SydneyBioX/ProjectClassifyR (private).

Summary

Changes results (Ellis Patrick's decision). All assays, classifiers, selection methods and combinations in one crossValidate call are evaluated on the same training and test splits.

Why

Each assay, classifier and combination used to get its own random splits, drawn from the global random stream that earlier cross-validations had advanced. Two assays' fold assignments agreed for only 19% of samples, which is chance for 5 folds. So comparisons between assays in performancePlot and samplesMetricMap, as in the protocol paper, were not paired and included split-to-split noise. With shared splits the comparisons are paired.

What changes

  • The first cross-validation of a call keeps its seed and splits, and every later one uses them.
  • With shared splits, the final models no longer need to be fitted one after another in the main process to keep the random streams reproducible, so they are fitted in the worker pool, from the random state that follows making the splits.
  • ?crossValidate documents the shared splits.

Do results change?

Yes:

  • The first cross-validation of a call is the same as before.
  • Later ones differ, because their folds differ.
  • The results are again identical for any number of cores.

Evidence

  • Tested: every assay, classifier and merge combination has the same fold assignments.
  • The regression harness (part 6 → part 7): scenarios with one cross-validation per call are identical (DLDA, random forest, SVM, leave-one-out, criss-cross), and scenarios with several differ in the later ones.

To reject

Close this pull request. Part 6 alone keeps separate splits, with identical results to before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4

ellispatrick and others added 2 commits October 11, 2026 09:45
…the same folds (changes results)

Why (Ellis Patrick's decision): each assay, classifier, selection method and combination was cross-validated
on its own random splits, because the splits were drawn from the global random stream that earlier
cross-validations had advanced (fold assignments of two assays agreed for 19% of samples, chance for 5 folds).
So comparisons between them in performancePlot and samplesMetricMap were not paired by fold and included
split-to-split noise. With shared folds the comparisons are paired, and per-assay work could be reused across
combinations.

What: the first cross-validation of a call keeps its seed and splits, and every later one uses them. With the
splits shared, the final models no longer need to be fitted one after another in the main process to keep the
random streams reproducible, so they are fitted in the worker pool, from the random number state that follows
making the splits.

Consequence: the first cross-validation of a call gives the same results as before; later ones differ because
their folds differ. Tested: every assay, classifier and merge combination has the same fold assignments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
@ellispatrick
ellispatrick force-pushed the review/7-shared-folds branch from acdc0a4 to 21ad9ab Compare October 10, 2026 22:47
@ellispatrick
ellispatrick force-pushed the review/7-shared-folds branch from 21ad9ab to 5bfd793 Compare October 14, 2026 00:20
@DarioS
DarioS added this pull request to stack #148 October 28, 2026 02:13
@DarioS
DarioS marked this pull request as ready for review October 28, 2026 02:15
@DarioS
DarioS merged commit cd815ec into review/5-maintenance Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants