Spectator variables in TMVA evaluation

Dear ROOTers,

I have a weight file for a BDT trained with TMVA and I’m creating a reader class to be used in the analysis chain.
I noticed that if the weight files declares some spectators and I don’t add them to the reader then during evaluation I get the following error

<FATAL>                          : Dataset[Default] : You declared 0 spectators in the Reader while there are 2 spectators declared in the file
***> abort program execution

I fail to understand, however, why the spectators would be needed in the evaluation phase. Is there some workaround to avoid to add spectators to the reader (besides editing the weight file, which I would like to avoid)?

Cheers,
Valerio

Hi,

Unfortunately there is no way of disabling this check, they have to be declared to the reader. I guess to ensure you are using the same set up for training and application. Superficially I agree, there should be no need to input them to the reader (except if you use the new cross validation interface with cross evaluation!).

However the, loading process explicitly states that all spectators need to be declared, and in declared in the same order as in training file. Maybe @moneta can shed some light on the reasoning here?

Cheers,
Kim