# BDTG Multiclass standalone C++ class response

**URL:** <https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705>\
**Category:** TMVA\
**Created:** [November 21, 2018, 12:07pm UTC](https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705 "2018-11-21T12:07:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljbeemster](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@ljbeemster](https://root-forum.cern.ch/u/ljbeemster)\
**Post date:** [November 21, 2018, 12:07pm UTC](https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705/1 "2018-11-21T12:07:37Z")

</div>

Hi TMVA experts,

The multiclass training of a BDTG method results in a standalone C++ class in the weights directory, but I’m confused how to get a multiclass response using this. The TMVA::Reader has a EvaluateMulticlass() function which returns a vector with a response for each event class, but the standalone class only has a GetMvaValue(…) function which returns a single value (which always seems to return -1 for me, no matter which event class I provide it, but that might be another issue altogether).  
I’ve noticed that not all standalone classes are properly implemented, is this also what I’m running into now? Is this implementation incomplete, or am I missing something else to get a multiclass response from the BDTG standalone C++ class?

thanks!  
Lars

---

<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 21, 2018, 3:21pm UTC](https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705/2 "2018-11-21T15:21:02Z")

</div>

Hi,

Currently, the standalone c++ BDT classes do not support multiclass evalution.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![ljbeemster](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@ljbeemster](https://root-forum.cern.ch/u/ljbeemster)\
**Post date:** [November 21, 2018, 7:05pm UTC](https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705/3 "2018-11-21T19:05:34Z")

</div>

Hi Kim,

Thanks for your reply.  
Do you maybe have an idea how much work it is to build support for this? If the forest in ReadBDTG::Initialize() is correct and is just a matter of implementing the interface to it, I might be able to work it out my own, (and learn some things about BDTs in the proces 🙂).

cheers,  
Lars

---

<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 21, 2018, 8:31pm UTC](https://root-forum.cern.ch/t/bdtg-multiclass-standalone-c-class-response/31705/4 "2018-11-21T20:31:55Z")

</div>

Hi,

That would be much appreciated if you would have the time to look into it! In principle it shouldn’t be that difficult, the tricky part is that this code is generated by TMVA.

Looking at the implementation of `TMVA::MethodBDT::GetMulticlassValues` and `ReadBDTG::GetMvaValue__` should be good starting points for this!

Please have a look and submit a PR to the [root repository](https://github.com/root-project/root) if something would come out of it! For further communication you can use kim . albertsson [at] cern . ch
