TMVA: selection of events for testing


I have a question about the method TMVA::factory::PrepareTrainingAndTestTree.

I would like to make the separation of the events for training and testing fully reproducible and I’m not sure if this is possible using the PrepareTrainingAndTestTree method.
I see in the UserGuide that the possible split modes are ‘Random’, ‘Alternate’ and ‘Block’.
In order to make the event separation fully reproducible, I would need to employ a User-defined function, which could be as simple as looking at the value of a variable stored in the tree.
Please note that ‘Random’ and ‘Alternate’ don’t comply with my requirement, because the ordering of the events in the ntuple can change among different people and in the time.

Is it possible to achieve that with the PrepareTrainingAndTestTree methood?

Of course, I could achieve the same passing the events one by one using the methods called AddBackgroundTestEvent, AddBackgroundTraningEvent, etc, but I was wondering if the same is possible with PrepareTrainingAndTestTree.

Thanks, Best Regards,
Luca Fiorini


sorry for the delay, I’m not following the ‘roottalk’ but rather the TMVA mailing list for TMVA related questions.

Guess you’ve by now reverted to using ‘AddTraining/TestEvent’ which in fact would be the only way to make such user event selection for training/testing as you demand.