# Wrong TMVA response on the TMVA Rectangular Cuts Method

**URL:** <https://root-forum.cern.ch/t/wrong-tmva-response-on-the-tmva-rectangular-cuts-method/27198>\
**Category:** TMVA\
**Created:** [December 6, 2017, 4:21pm UTC](https://root-forum.cern.ch/t/wrong-tmva-response-on-the-tmva-rectangular-cuts-method/27198 "2017-12-06T16:21:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![p73](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/p73/32/14141_2.png) [@p73](https://root-forum.cern.ch/u/p73)\
**Post date:** [December 6, 2017, 4:21pm UTC](https://root-forum.cern.ch/t/wrong-tmva-response-on-the-tmva-rectangular-cuts-method/27198/1 "2017-12-06T16:21:50Z")

</div>

I am using TMVA Rectangular Cuts Method.  
So here it is my `xml` file after training.  
 ![screenshot-20171206-23:06:33](https://root-forum.cern.ch/uploads/default/original/2X/4/465df4a6ef3eb749a6883181522f6a0865e639f5.png)  
I want to get tmva response from `TMVA::Reader` when testing trained method. So I write (inside a loop over events). NOTE: I test a BACKGROUND tree, the same as I used for training. So I am interested in the background efficiency.

```auto
if ( ! reader->EvaluateMVA( "Cuts", 9.8e-1 ) ) { continue; }

```

Here I use another method `PrintCuts` to confirm parameters of this ROC point:  
 ![screenshot-20171206-23:18:20](https://root-forum.cern.ch/uploads/default/original/2X/f/f8a95f63bd4c90cad80d6302759a01c15cfdb6f8.png)  
Then I have actual efficiency which is equal to (surprise, surprise) 0.4267. Why not something about 2.36e-1? But if instead of 9.8e-1 I write 9.799999 I get (surprise, surprise) 0.231969. So what happens here? Is it a bug?

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [December 11, 2017, 4:16pm UTC](https://root-forum.cern.ch/t/wrong-tmva-response-on-the-tmva-rectangular-cuts-method/27198/2 "2017-12-11T16:16:06Z")

</div>

Hi,

I’ve been looking into this issue a bit. My conclusion so far is that there is an of by one error somewhere in the histogram generation. Can you work around this for the time being?

One approach to getting the correct efficiency estimation would be to run the “Test Tree” through the classifier and calculating the corresponding score. The resulting value is what _should_ be in the printout of `PrintCuts`.

Sorry for the inconvenience 😕

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![p73](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/p73/32/14141_2.png) [@p73](https://root-forum.cern.ch/u/p73)\
**Post date:** [December 11, 2017, 7:38pm UTC](https://root-forum.cern.ch/t/wrong-tmva-response-on-the-tmva-rectangular-cuts-method/27198/3 "2017-12-11T19:38:36Z")

</div>

> [@kialbert](#):
>
> Can you work around this for the time being?

Selbstverständlich, no problem.
