[tutorials][ML] Add RDataLoader classification tutorial with XGBoost#22847
[tutorials][ML] Add RDataLoader classification tutorial with XGBoost#22847siliataider wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
I'm curious: is there an advantage of using the batching data loader for loading all data at once? RDataFrame.AsNumpy seems completely fine here.
Your new code can maybe be seen as a usage example of the RDataLoader, but I would rather do this only in tutorials where the data is actually loaded in batches. Otherwise, we risk sending the wrong message that getting your ROOT data to Numpy is not as easy as one line RDataFrame.AsNumpy.
|
Fair point. There are a couple of advantages of using the rdataloader though:
So:
My goal at the end is to have a tutorial showing how to do XGBoost training with the RDataLoader |
As you see in the existing tutorial, adding the weights as NumPy arrays is not hard, so I wouldn't really call it an advantage of the data loader.
The same argument I made earlier still applies: even if you merge the
That's not what you show in this tutorial. You're showing how to convert ROOT data to NumPy arrays via the RDataLoader, for which I don't see why you'd do that 🙂 And now the tutorial sends the (what I think wrong) message that the RDataLoader is the right way to do this conversion. And since the XGBoost algo is also not designed to re-read training data in each iteration, but it converts it into an internal quantized representation once in the beginning, there is also no way do directly hook in the data loader into XGBoost training. |
92e8d8a to
e24e8a3
Compare
e24e8a3 to
391a7b2
Compare
|
Fair enough modifying The use case comes from workflows where users want to:
You're correct that for simple one-shot loading, |
There was a problem hiding this comment.
Nice, thank you! Just two small suggestions: I'd refrain from mentioning tmva101 and make it more clear that this tutorial is not XGBoost specific: you'd do exactly the same for any other classifier. Maybe even show a different one, like logistic regression from scikit learn. I'd even consider renaming the tutorial to ml_dataloader_classification.py, but actually sticking with XGBoost in the title might make it more attractive... Can't decide for myself 🙂
Test Results 23 files 23 suites 3d 12h 47m 31s ⏱️ For more details on these failures, see this check. Results for commit 391a7b2. |
391a7b2 to
95dec3f
Compare
This Pull request:
Changes:
Adds a new tutorial
ml_dataloader_XGBoost.pydemonstrating XGBoost training using RDataLoader to stream data directly from EOS without intermediate files stored after the shuffling/splitting phase.This tutorial is inspired from the tmva101_Training workflow but eliminates the need for the tmva100_DataPreparation step which splits the dataset in 2 separate training/testing sets and stores 2 intermediate files.