# Some problems arise when work with TMVA Rectangular Cuts method

**URL:** <https://root-forum.cern.ch/t/some-problems-arise-when-work-with-tmva-rectangular-cuts-method/26975>\
**Category:** TMVA\
**Created:** [November 21, 2017, 6:42am UTC](https://root-forum.cern.ch/t/some-problems-arise-when-work-with-tmva-rectangular-cuts-method/26975 "2017-11-21T06:42:52Z")\
**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:** [November 21, 2017, 6:42am UTC](https://root-forum.cern.ch/t/some-problems-arise-when-work-with-tmva-rectangular-cuts-method/26975/1 "2017-11-21T06:42:53Z")

</div>

I am working with TMVA Rectangular Cuts method. Until now I have encountered with some problems.

1. Wrong image of significance dependence on signal efficiency.
2. Different values for signal and background at the implementation and application stages.
3. The max and min ranges for cuts specified at the booking stage are not displaying correctly in `xml` file.

**Significance graph**  
After training and testing I use  
 ![screenshot-20171121-13:20:32](https://root-forum.cern.ch/uploads/default/original/2X/9/924634db13e05fecb5fbb5aa17fd570aa11a6f6d.png)  
via `TMVA::GUI`. After that I see the following bunch of graphs

 ![screenshot-20171121-13:24:06](https://root-forum.cern.ch/uploads/default/original/2X/b/ba65e4c4d7913b3305f48cc7d960ef3ae049f440.png)  
where obviously the green line is displayed wrong. Note that for `kNN` classifier there is no such problem.  
EDIT: It seems there is such a problem only if one uses the Genetic Algorithm. For example, if try it with Monte Carlo the green line is normal displayed.

**Signal and background values**  
After training I go to the `xml` file where the weights are storing and see the following:  
 ![screenshot-20171121-13:31:23](https://root-forum.cern.ch/uploads/default/original/2X/9/943cb4eb9485be9ca35bdd69ec6d92fed830ce45.png)  
In the application process I request the response of `Cuts` method:

```auto
    for ( Long64_t entry = 0; entry < nentries; entry++ )
    {
        analysedTree->GetEntry( entry );
        //Get TMVA response
        id = (Double_t)reader->EvaluateMVA( "Cuts", effS );
        //Fill hist
        Cuts_classID->Fill( id );
    }
    Cuts_classID->Write();

```

And it seems that it is 1 for signal and 0 for background. Very inconvenient.

**Range for cuts**  
I specify ranges for cuts in this way:

```auto
    factory->BookMethod( dataloader, TMVA::Types::kCuts, "Cuts", "FitMethod=GA:EffMethod=EffSel:CutRangeMin:CutRangeMax[0]=2500:CutRangeMax[1]=1500" );

```

but then in the `xml` file I see

 ![screenshot-20171121-13:37:50](https://root-forum.cern.ch/uploads/default/original/2X/c/caf98ad4296a85cdaee3978f3653246060ed3d33.png)  
And cuts values I see too high (bigger than specified) anyway.  
Is it OK? How one should interpret this?

I would be thankful for any explanation or discussion on this matter.

---

<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:** [November 22, 2017, 11:46am UTC](https://root-forum.cern.ch/t/some-problems-arise-when-work-with-tmva-rectangular-cuts-method/26975/2 "2017-11-22T11:46:51Z")

</div>

Hi,

Regarding 1:  
Interesting that the plot is incorrect only for a certain fitter. That is indeed a bug. I’ll file a bug report. Great that you provided that BookMethod’s options string.

Regarding 2:  
The xml-file uses an internal representation. From your `DataSetInfo` you can retrieve the index of the signal class with `DataSetInfo::GetSignalClassIndex()`. The order in the xml is dependent on the order of declaration in the original `DataLoader`. The returned index represents the signal class regardless of initialisation order.

Regarding 3:  
This is also something that we of the TMVA team must look into. Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [December 6, 2017, 11:47am UTC](https://root-forum.cern.ch/t/some-problems-arise-when-work-with-tmva-rectangular-cuts-method/26975/3 "2017-12-06T11:47:06Z")

</div>

Closed on December 6, 2017, 11:47am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
