RDataLoader: wrong train/validation split with lazy loading, filtered inputs and shuffle=False
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
root-project/root のほかの issue
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newline対応中かも @dpiparo が 10 日前に担当しました。 オープンbug in:Build System
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
root-project/root#23746 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Header cleanup campaign対応中かも @hageboeck が 1 日前に担当しました。 オープン
root-project/root#23880 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[graph] TScatter / TScatter2D stops drawing remaining points if a non-positive value is encountered in log scale対応中かも @muntasir-396 が 4 日前に担当しました。 オープンgood first issue improvement in:Graphics
root-project/root#23833 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
TDataMember::GetOffset interfers to TDataMember::GetOffsetCint対応中かも @pcanal が 7 日前に担当しました。 オープンbug in:Core Libraries
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
root-project/root#23777 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
`TChain::GetEntries` internal caching ineffective?対応中かも @pcanal が 13 日前に担当しました。 オープンimprovement in:TTree
root-project/root#23738 · コメント 6 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
root-project/root の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
status:needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PX4/PX4-Autopilot#29496 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
madskristensen/FileIcons#385 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoft/SysmonCommon#26 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
espressif/esp-matter#1913 ·