# TMVA v4.1.2: bug in MethodBDT::SetTuneParameters()?

**URL:** <https://root-forum.cern.ch/t/tmva-v4-1-2-bug-in-methodbdt-settuneparameters/13645>\
**Category:** TMVA\
**Created:** [January 20, 2012, 11:02pm UTC](https://root-forum.cern.ch/t/tmva-v4-1-2-bug-in-methodbdt-settuneparameters/13645 "2012-01-20T23:02:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xlei](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/x/e0b2c6/32.png) [@xlei](https://root-forum.cern.ch/u/xlei)\
**Post date:** [January 20, 2012, 11:02pm UTC](https://root-forum.cern.ch/t/tmva-v4-1-2-bug-in-methodbdt-settuneparameters/13645/1 "2012-01-20T23:02:01Z")

</div>

Hi,

For BDT with gradient boosting, when running factory-\>OptimizeAllMethods(), “Shrinkage” is scanned but its value is never reset in each iteration.

In MethodBDT::OptimizeTuningParameters(), it says:

else if (fBoostType==“Grad”){  
tuneParameters.insert(std::pair\<TString,Interval\>(“Shrinkage”, Interval(0.05,0.50,5)));  
}

But in MethodBDT::SetTuneParameters, it says:

for(it=tuneParameters.begin(); it!= tuneParameters.end(); it++){  
if (it-\>first == “MaxDepth” ) SetMaxDepth ((Int\_t)it-\>second);  
if (it-\>first == “NodeMinEvents” ) SetNodeMinEvents ((Int\_t)it-\>second);  
if (it-\>first == “NTrees” ) SetNTrees ((Int\_t)it-\>second);  
if (it-\>first == “NodePurityLimit”) SetNodePurityLimit (it-\>second);  
if (it-\>first == “AdaBoostBeta” ) SetAdaBoostBeta (it-\>second);  
}

Scanning this parameter makes OptimizeAllMethods() N times slower. And since the value of the parameter is never reset, this brings us nothing. The same thing goes for the paramter “UseNvars”. On the other hand, “NodePurityLimit” is not scanned but it is reset in every iteration.

Since I didn’t find an existing thread on this, I am writing the post as a bug report. Or, am I missing something?

Thanks,  
Xiaowen

---

<div class="post-metadata">

**Author:** ![jlow](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/d6d6ee/32.png) [@jlow](https://root-forum.cern.ch/u/jlow)\
**Post date:** [September 27, 2012, 10:14am UTC](https://root-forum.cern.ch/t/tmva-v4-1-2-bug-in-methodbdt-settuneparameters/13645/2 "2012-09-27T10:14:19Z")

</div>

Hi developers,

Any news on this?

Thanks,  
Jia
