Skip to content

[ML] Split the filtered lazy dataset with multiple clusters like the unfiltered one - #23843

Merged
dpiparo merged 2 commits into
root-project:masterfrom
siliataider:rdataloader
Oct 27, 2026
Merged

dpiparo merged 2 commits into
root-project:masterfrom
siliataider:rdataloader

Conversation

@siliataider

@siliataider siliataider commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This happens because for the filtered dataframes, we discover the cluster counts as we go, and attribute the train/test splits as we go, therefore the logic takes a separate part in the code, that slightly drifted from the unfiltered path :)

This PR fixes #23842

@siliataider siliataider changed the title Rdataloader [ML] Split the filtered lazy dataset with multiple clusters like the unfiltered one Oct 26, 2026
@siliataider siliataider self-assigned this Oct 26, 2026
@siliataider siliataider added in:ML Everything under ROOT/ML AI-Assisted labels Oct 26, 2026

@vepadulano vepadulano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Changes LGTM overall, but consider a few minor comments before merging.

Comment thread bindings/pyroot/pythonizations/test/ml_dataloader.py Outdated
Comment thread bindings/pyroot/pythonizations/test/ml_dataloader.py Outdated
Comment thread tree/ml/src/RClusterLoader.cxx
@siliataider
siliataider force-pushed the rdataloader branch 2 times, most recently from ffdb990 to bb3d3a6 Compare October 26, 2026 13:04
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Test Results

    24 files      24 suites   3d 22h 58m 20s ⏱️
 3 896 tests  3 896 ✅ 0 💤 0 ❌
83 441 runs  83 441 ✅ 0 💤 0 ❌

Results for commit 43960a9.

♻️ This comment has been updated with latest results.

@siliataider siliataider added this to the 6.42.00-rc1 milestone Oct 27, 2026
The shuffled branch of `RClusterLoader::SplitDataset()` rounded the training entries down (`int(N * (1 - split))`),
while the unshuffled branch and the eager loading round the validation entries down (`N - int(split * N)`).
The same dataset could therefore get one more validation entry when shuffled,
e.g. 3 instead of 2 for 6 entries and a split of 0.4.
All modes now round the validation entries down.
…unfiltered one

For filtered RDataFrames, the split is discovered while loading the first lazy epoch, and it always split every cluster proportionally,
which is what's supposed to happen when shuffling is enabled only.
This is now changed to take the first part of the whole dataset and attribute it to training, and the tail to validation, like the other
loading paths do.

Assisted-by: Claude Opus 5.5
@dpiparo
dpiparo merged commit f853c28 into root-project:master Oct 27, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Assisted in:ML Everything under ROOT/ML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDataLoader: wrong train/validation split with lazy loading, filtered inputs and shuffle=False

3 participants