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

**URL:** <https://root-forum.cern.ch/t/problem-with-tmva-break-floating-point-exception/6159>\
**Category:** TMVA\
**Created:** [March 3, 2008, 2:18pm UTC](https://root-forum.cern.ch/t/problem-with-tmva-break-floating-point-exception/6159 "2008-03-03T14:18:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardcb](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/c6cbf5/32.png) [@eduardcb](https://root-forum.cern.ch/u/eduardcb)\
**Post date:** [March 3, 2008, 2:18pm UTC](https://root-forum.cern.ch/t/problem-with-tmva-break-floating-point-exception/6159/1 "2008-03-03T14:18:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stelzer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/94ad74/32.png) [@stelzer](https://root-forum.cern.ch/u/stelzer)\
**Post date:** [March 4, 2008, 8:41am UTC](https://root-forum.cern.ch/t/problem-with-tmva-break-floating-point-exception/6159/2 "2008-03-04T08:41:25Z")

</div>

Hi Eduard,

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

Cheers,  
Joerg

---

<div class="post-metadata">

**Author:** ![hoecker](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/ad7895/32.png) [@hoecker](https://root-forum.cern.ch/u/hoecker)\
**Post date:** [March 14, 2008, 10:04pm UTC](https://root-forum.cern.ch/t/problem-with-tmva-break-floating-point-exception/6159/3 "2008-03-14T22:04:22Z")

</div>

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 😉 We’ll improve this.

Cheers,  
Andreas
