Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ
#23,842 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@siliataider がすでに取り組んでいます。

2026年10月26日 から。

  • #23843 @siliataider による — オープン

評価

この issue はまだ評価されていません。

説明

bug in:ML
Check duplicate issues.
  • Checked for duplicates
Description

With lazy loading, filtered input dataframes and shuffle=False, train_test_split doesn't make the contiguous split used for unfiltered inputs.

Expected: the first 1 - test_size fraction of the entries goes to training and the rest to validation.
Instead, each cluster is split proportionally, as with shuffle=True.

The training count is also rounded differently (int(N * (1 - test_size)) instead of N - int(N * test_size)).

This only shows up when the filtered dataset spans more than one cluster for example with two input dataframes. It comes from the filtered split discovery in RClusterLoader::LoadTrainingClusterInto.

Reproducer
import ROOT

# two files of 10 entries each: b1 = 0..9 and b1 = 10..19
for i in range(2):
    ROOT.RDataFrame(10).Define("b1", f"(int) rdfentry_ + {10 * i}").Snapshot("tree", f"file{i}.root")

# keep the even entries
dfs = [ROOT.RDataFrame("tree", f"file{i}.root").Filter("b1 % 2 == 0") for i in range(2)]

dl = ROOT.Experimental.ML.RDataLoader(
    dfs, batch_size=2, shuffle=False, drop_remainder=False, set_seed=42
)
train, val = dl.train_test_split(test_size=0.4)

print("train:", sorted(int(v) for batch in train.as_numpy() for v in batch.flatten()))
print("val:  ", sorted(int(v) for batch in val.as_numpy() for v in batch.flatten()))

Output:

train: [0, 2, 4, 10, 12, 14]
val:   [6, 8, 16, 18]

Expected:

train: [0, 2, 4, 6, 8, 10]
val:   [12, 14, 16, 18]
ROOT version

master

Installation method

Build form source

Operating system

Linux, fedora

Additional context

No response

主要言語
C++
スター
3.3k
フォーク
1.6k
平均マージ
2日 15時間
マージ済み PR(30日)
207

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

root-project/root のほかの issue

root-project/root の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。