# Multiclass BDT, number of Test/Training events

**URL:** <https://root-forum.cern.ch/t/multiclass-bdt-number-of-test-training-events/26981>\
**Category:** TMVA\
**Created:** [November 21, 2017, 12:27pm UTC](https://root-forum.cern.ch/t/multiclass-bdt-number-of-test-training-events/26981 "2017-11-21T12:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordan](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jordan](https://root-forum.cern.ch/u/jordan)\
**Post date:** [November 21, 2017, 12:27pm UTC](https://root-forum.cern.ch/t/multiclass-bdt-number-of-test-training-events/26981/1 "2017-11-21T12:27:27Z")

</div>

Dear all,

I try to use a multi-class BDTG but I cannot set the number of events used for training and testing.

In usual binary BDT I use :  
dataloader-\>PrepareTrainingAndTestTree("", “Random:nTest\_Signal=5000:nTest\_Background=5000”);

wich does the job. Trying the same thing in BDTG multi-class gives me this error :  
 : The following options were specified, but could not be interpreted: ‘nTest\_Signal=5000:nTest\_Background=5000’, please check!

I suppose that this option is not valid in multi-class (and I can understand that) but I do not find an other way that can works within multi-class BDTG.

I am very new in using TMVA and ROOT and I apologize if my question is trivial.

Thanks for your time,  
Jordan

---

<div class="post-metadata">

**Author:** ![behrenhoff](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/behrenhoff/32/12285_2.png) [@behrenhoff](https://root-forum.cern.ch/u/behrenhoff)\
**Post date:** [November 21, 2017, 1:04pm UTC](https://root-forum.cern.ch/t/multiclass-bdt-number-of-test-training-events/26981/2 "2017-11-21T13:04:18Z")

</div>

It depends on how you name your input trees.

If you add trees like this:

```auto
AddTree(treeClass1, "inputClass1", ...)
...
AddTree(treeClassN, "inputClassN", ...)

```

You need to call:  
`PrepareTrainingAndTestTree("", "nTest_inputClass1=5000:(...):nTest_inputClassN=5000")`  
I.e. specify the events for every class.

---

<div class="post-metadata">

**Author:** ![jordan](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jordan](https://root-forum.cern.ch/u/jordan)\
**Post date:** [November 21, 2017, 2:36pm UTC](https://root-forum.cern.ch/t/multiclass-bdt-number-of-test-training-events/26981/3 "2017-11-21T14:36:22Z")

</div>

This works perfectly, thank you for your help !
