# How to customise separation gain and boosting weight in BDTs?

**URL:** <https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577>\
**Category:** TMVA\
**Created:** [May 24, 2020, 10:20pm UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577 "2020-05-24T22:20:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oguloncel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oguloncel/32/20692_2.png) [@oguloncel](https://root-forum.cern.ch/u/oguloncel)\
**Post date:** [May 24, 2020, 10:20pm UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577/1 "2020-05-24T22:20:07Z")

</div>

Dear Experts,

I am trying to understand how the separation gain (for example Gini) and boosting weight expressions can be customised/modified in classification problems with BDTs.

To provide some context, what I am trying to achieve is to combine information from systematically varied samples to my nominal-sample-trained BDT to make it less sensitive to systematical variations. Such as having a penalty term in gain expression when it is different for these alternative datasets compared to nominal dataset.

It seems like there is a list of fixed methods to be chosen however no option for a user defined function expression for separation gain and/or boosting weights in which different calculations of these values can be compared.

Are there some ways to achieve it or does one need to have a local copy of ROOT and modify the TMVA code accordingly?

Thank you in advance!

Ogul Oncel

---

<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 28, 2020, 7:28am UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577/2 "2020-05-28T07:28:27Z")

</div>

Hello Ogul,  
Unfortunatly to apply this type of customization requires you to customize your local copy of ROOT and modify the TMVA code according to your needs. I would suggest you to use git, clone the repository and create a new branch with your modification, that you can always rebase in the future to new ROOT versions.  
Best regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![oguloncel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oguloncel/32/20692_2.png) [@oguloncel](https://root-forum.cern.ch/u/oguloncel)\
**Post date:** [May 28, 2020, 8:41am UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577/3 "2020-05-28T08:41:41Z")

</div>

Hello Lorenzo,

Thanks a lot for your reply and the recommendation!

In relation to that, could you also comment on the TMVA::Event::ScaleBoostWeight function. Is it possible to call this function from usual training setup to scale the boosting weight for certain type (having specified nJets, pT range etc…) of events in a away similar to SetSignalWeightExpression? Or is it just an internal function that needs customisation locally?

Best regards,

Ogul

---

<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 28, 2020, 9:12am UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577/4 "2020-05-28T09:12:12Z")

</div>

Hi,

It is an internal function used by MethodBDT and MethodBoost to set the event boosting weight that is used to build the combined boosted classifier, see for example chapter 7 of the TMVA Users guide,

> **[TMVAUsersGuide.pdf](https://github.com/root-project/root/blob/master/documentation/tmva/UsersGuide/TMVAUsersGuide.pdf)**

Lorenzo

---

<div class="post-metadata">

**Author:** ![oguloncel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oguloncel/32/20692_2.png) [@oguloncel](https://root-forum.cern.ch/u/oguloncel)\
**Post date:** [May 28, 2020, 1:28pm UTC](https://root-forum.cern.ch/t/how-to-customise-separation-gain-and-boosting-weight-in-bdts/39577/5 "2020-05-28T13:28:07Z")

</div>

Hi Lorenzo,

Thank you very much indeed for the clarification. Clearly there is no easy way around:)

Best,

Ogul
