# Testing a BDT on a mixed sig/bg tree

**URL:** <https://root-forum.cern.ch/t/testing-a-bdt-on-a-mixed-sig-bg-tree/25281>\
**Category:** TMVA\
**Created:** [June 23, 2017, 10:33pm UTC](https://root-forum.cern.ch/t/testing-a-bdt-on-a-mixed-sig-bg-tree/25281 "2017-06-23T22:33:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdule](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/g/e36b37/32.png) [@gdule](https://root-forum.cern.ch/u/gdule)\
**Post date:** [June 23, 2017, 10:33pm UTC](https://root-forum.cern.ch/t/testing-a-bdt-on-a-mixed-sig-bg-tree/25281/1 "2017-06-23T22:33:34Z")

</div>

Hello,

For the purpose of training the BDT, I must have a TreeS and a TreeB.  
However, after training my BDT, I would now like to test its abilities on some “real data”, which means that the data is not separated to signal and background, but rather they are mixed together (on lets say, treeData).  
What method should I call in order to do so?

Also, when given only TreeS and TreeB, I presume that in the testing phase, the testing is being done on the sum of the variables of the two trees, right?

Thank you.

---

<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:** [June 26, 2017, 9:35am UTC](https://root-forum.cern.ch/t/testing-a-bdt-on-a-mixed-sig-bg-tree/25281/2 "2017-06-26T09:35:37Z")

</div>

Hi,

You could for example use `SetInputTrees`. In ROOT 6 this is found in the dataloader: [https://root.cern.ch/doc/master/classTMVA\_1\_1DataLoader.html#ae3925a04a28575f355d5f754716cc7c8](https://root.cern.ch/doc/master/classTMVA_1_1DataLoader.html#ae3925a04a28575f355d5f754716cc7c8)

In ROOT 5 it is found in the factory [https://root.cern.ch/root/html534/TMVA\_\_Factory.html#TMVA\_\_Factory:SetInputTrees@1](https://root.cern.ch/root/html534/TMVA __Factory.html#TMVA__ Factory:SetInputTrees@1)

If you specify nothing else in your call to `PrepareTrainingAndTestTree()` TMVA will split your data into two equal size parts, 50% of the data (both signal and background) will be used to train your BDT. After training, the BDT will be evaluated on the other 50% of the data.
