Skip to content
Snippets Groups Projects
Unverified Commit 69be1d46 authored by Kim Albertsson's avatar Kim Albertsson Committed by GitHub
Browse files

[TMVA] CV - Add workaround for large event numbers (#2971)

* [TMVA] CV - Add workaround for large event numbers

Currently TMVA considers all internal variables floats, if large event
numbers are then input as part of "cv-in-app" these can overflow the
float resulting in erroneous fold assignments.

A workaround is to reduce the input range when reading the input from
the TTree as TTreeFormula retains awareness of the input type.
parent 2510cd85
Branches
Tags
No related merge requests found
......@@ -135,6 +135,15 @@ int TMVACrossValidation()
// Spectator used for split
dataloader->AddSpectator("eventID", 'I');
// NOTE: Currently TMVA treats all input variables, spectators etc as
// floats. Thus, if the absolute value of the input is too large
// there can be precision loss. This can especially be a problem for
// cross validation with large event numbers.
// A workaround is to define your splitting variable as:
// `dataloader->AddSpectator("eventID := eventID % 4096", 'I');`
// where 4096 should be a number much larger than the number of folds
// you intend to run with.
// Attaches the trees so they can be read from
dataloader->AddSignalTree(sigTree, 1.0);
dataloader->AddBackgroundTree(bkgTree, 1.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment