# TMVA PlotDecisionBoundary.C with custom variables

**URL:** <https://root-forum.cern.ch/t/tmva-plotdecisionboundary-c-with-custom-variables/24610>\
**Category:** TMVA\
**Created:** [May 2, 2017, 12:21pm UTC](https://root-forum.cern.ch/t/tmva-plotdecisionboundary-c-with-custom-variables/24610 "2017-05-02T12:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daiktas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/daiktas/32/19799_2.png) [@daiktas](https://root-forum.cern.ch/u/daiktas)\
**Post date:** [May 2, 2017, 12:21pm UTC](https://root-forum.cern.ch/t/tmva-plotdecisionboundary-c-with-custom-variables/24610/1 "2017-05-02T12:21:39Z")

</div>

Dear users,

I am using PlotDecisionBoundary.C to plot decision boundaries for custom variables which I defined and then used to train a BDT.

As a concrete example to illustrate the problem, I used  
factory-\>AddVariable( “var0 + var1”, “GeV”, ‘F’);  
where var0 and var1 are branches of the tree used to train the BDT.

I encounter the problem when using the PlotDecisionBoundary.C file here:

// Set branch addresses.  
signal-\>SetBranchAddress(v0,&svar0);  
signal-\>SetBranchAddress(v1,&svar1);  
background-\>SetBranchAddress(v0,&bvar0);  
background-\>SetBranchAddress(v1,&bvar1);

as there is obviously no branch for var2 in the original tree, only for var0 and var1. Is there a simple workaround for this?

Thank you

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [May 9, 2017, 1:25pm UTC](https://root-forum.cern.ch/t/tmva-plotdecisionboundary-c-with-custom-variables/24610/2 "2017-05-09T13:25:28Z")

</div>

Hi,

I am not sure I have understood your problem, Which macro is PlotDecisionBoundary.C ? Is it maybe part of the standalone distribution but I don;t think is in the ROOT repository.

It is not clear also which error are you getting. Please port a reproducible example including the minimal data set

Thank you

Lorenzo
