# TMVAMulticlass AddTree

**URL:** <https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884>\
**Category:** TMVA\
**Created:** [May 2, 2018, 11:37am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884 "2018-05-02T11:37:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [May 2, 2018, 11:37am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884/1 "2018-05-02T11:37:32Z")

</div>

Dear experts,  
I do not see why when I run my TMVAMulticlass (1) in the output I (2) see 4 background instead of 3 and it calls tha last one “Background” and it does not have any entries? Do you see what is wrong?  
Regards

(1)  
[http://calpas.web.cern.ch/calpas/TMVAMulticlass.C](http://calpas.web.cern.ch/calpas/TMVAMulticlass.C)

(2)  
[http://calpas.web.cern.ch/calpas/log\_mva](http://calpas.web.cern.ch/calpas/log_mva)

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [May 3, 2018, 8:26am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884/2 "2018-05-03T08:26:40Z")

</div>

Dear experts,  
any ideas?  
Regards

---

<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:** [May 3, 2018, 9:00am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884/3 "2018-05-03T09:00:08Z")

</div>

Try changing the name `Signal` to something else.

---

<div class="post-metadata">

**Author:** ![calbet](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/4af34b/32.png) [@calbet](https://root-forum.cern.ch/u/calbet)\
**Post date:** [May 3, 2018, 9:02am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884/4 "2018-05-03T09:02:52Z")

</div>

Dear Kialbert,  
it does not change anything.  
Regards

---

<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:** [May 3, 2018, 9:15am UTC](https://root-forum.cern.ch/t/tmvamulticlass-addtree/28884/5 "2018-05-03T09:15:02Z")

</div>

It’s because of `SetBackgroundWeightExpression`. In multiclass, this function should only be called with `AnalysisType=Classification`. (This could be made more clear). Because of this, the function assumes a class named “Background” will exist.

If you want to have the same weight expression for a number of classes, you have to specify it several times.

```auto
dataloader->SetWeightExpression("expr", "bg0");
dataloader->SetWeightExpression("expr", "bg1");
dataloader->SetWeightExpression("expr", "bg2");

```

Cheers,  
Kim
