Problem with TMVA ( *** Break *** floating point exception)

Hello

I am trying to read back some BDT I optimized using TMVA in ROOT 5.18 (I also see this problem in 5.16) and after running these lines:

gSystem->Load(“libTMVA”); // and of course the TMVA library
TMVA::Reader reader("!Color");
string dir = “/home/eduard/TMVA_Study/weights/”;
string prefix = “TMVAnalysis”;
reader->BookMVA( “BDT method”, dir + prefix + “_BDT.weights.txt” );

I get this:

root [0]
Processing RooMassPlot-test-BDT.C…
— Reader : Parsing option string:
— Reader : “!Color”
— Reader : The following options are set:
— Reader : - By User:
— Reader : Color: “False” [color flag (default on)]
— Reader : - Default:
— Reader : V: “False” [verbose flag]
— Reader : Booking method tag “BDT method”

*** Break *** floating point exception

And that’s all.

Any idea of what could be the problem?

In both cases (v5.18 and v5.16) I got ROOT sources and compiled locally using the configure file. Everything seems to work OK, I used TMVA to created the BDT, I can visualize the TMVA.root file using TMVAGui.C and produce plots, I also have RooFit as well and I have used this installation without problems. In addition, I see this problem on SLC4 and on cygwin. It could probably be related to the TMVAnalysis_BDT.weights.txt file that I am trying to read, but I already rerun TMVA many times to produces this file with different configurations and I always get this problem. I can read the file for the Fisher classifier for example.

Thanks for any help,
Eduard

Hi Eduard,

thanks fro reporting this problem, we are having a look at it asap. Let us get back to you.

Cheers,
Joerg

Hello Eduard,

Apologies for this very late reply ! Your problem is that you did not register the variables the reader uses. Please check the TMVApplication.C example script for the reader. After creation of the Reader object, you first need to declare the variables, ie (as in the example - of course you replace this by your variables):

root [1] Float_t var1, var2;
root [2] Float_t var3, var4;
root [3] reader->AddVariable( “var1+var2”, &var1 );
root [4] reader->AddVariable( “var1-var2”, &var2 );
root [5] reader->AddVariable( “var3”, &var3 );
root [6] reader->AddVariable( “var4”, &var4 );

and only now book your BDT. Then it should work correctly. In principle this “AddVariable” is not necessarily required for the reading process (the application of the “expert”), but we request it in order to ensure the compatibility between the defined variables and the training (weight) file. The reader verifies the consistency of the variable names with the information given in the file.

I accept the criticism though that “floating point exception” is not a very clear error message :wink: We’ll improve this.

Cheers,
Andreas