# SeparationType option ignored for Gradient Boosted Decision trees?

**URL:** <https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373>\
**Category:** TMVA\
**Created:** [July 1, 2017, 10:03pm UTC](https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373 "2017-07-01T22:03:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre\_Holzner](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/7ea924/32.png) [@Andre\_Holzner](https://root-forum.cern.ch/u/Andre_Holzner)\
**Post date:** [July 1, 2017, 10:03pm UTC](https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373/1 "2017-07-01T22:03:29Z")

</div>

Hello,

I tried to reproduce the calculation of variable importances for gradient boosted decision trees  
using GiniIndex as separation type with ROOT 6.08.06 .

After some debugging it looks like that for gradient boosted decision trees, the SeparationType option  
is essentially ignored, the corresponding field MethodBDT::fSepType is reset to NULL in MethodBDT::InitGradBoost() und not set again (see [https://github.com/root-project/root/blob/3c842ce20edc9bd72dbd40f1e7b071d6f49e4170/tmva/tmva/src/MethodBDT.cxx#L1536](https://github.com/root-project/root/blob/3c842ce20edc9bd72dbd40f1e7b071d6f49e4170/tmva/tmva/src/MethodBDT.cxx#L1536) ) and is still NULL when instances of DecisionTree are created.

The DecisionTree objects then effectively have a regression (square of residual) loss (see [https://github.com/root-project/root/blob/3c842ce20edc9bd72dbd40f1e7b071d6f49e4170/tmva/tmva/src/DecisionTree.cxx#L180](https://github.com/root-project/root/blob/3c842ce20edc9bd72dbd40f1e7b071d6f49e4170/tmva/tmva/src/DecisionTree.cxx#L180) ) and correspondingly also the separation gain for a node split is calculated using RegressionVariance, not using the metric specified by the SeparationType option.

Is this on purpose ?

best regards,

Andre

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 3, 2017, 9:22am UTC](https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373/2 "2017-07-03T09:22:39Z")

</div>

Maybe @moneta can help…

---

<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:** [July 3, 2017, 10:45am UTC](https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373/3 "2017-07-03T10:45:44Z")

</div>

I don’t know. I will forward your question to the author,

Cheers

Lorenzo

---

<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:** [July 3, 2017, 12:50pm UTC](https://root-forum.cern.ch/t/separationtype-option-ignored-for-gradient-boosted-decision-trees/25373/4 "2017-07-03T12:50:49Z")

</div>

Yes this is on purpose, the separation type is used by other boosting methods to calculate the response of of the decision tree leaves. Gradient boosting uses a specific equation for the leaf response which can be found in `TMVA::MethodBDT::GradBoost`. (This then overwrites what was already in the leaf.)

The start of the call chain that lead to `GradBoost` is at `MethodBDT::1335` which reads `Double_t bw = this->Boost(*fTrainSample, fForest.back());`.

Cheers,  
Kim
