# Reweight in tmva's bdt

**URL:** <https://root-forum.cern.ch/t/reweight-in-tmvas-bdt/50466>\
**Category:** Newbie\
**Tags:** tmva\
**Created:** [June 18, 2022, 8:35am UTC](https://root-forum.cern.ch/t/reweight-in-tmvas-bdt/50466 "2022-06-18T08:35:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NgJunKai](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ngjunkai/32/30046_2.png) [@NgJunKai](https://root-forum.cern.ch/u/NgJunKai)\
**Post date:** [June 18, 2022, 8:35am UTC](https://root-forum.cern.ch/t/reweight-in-tmvas-bdt/50466/1 "2022-06-18T08:35:10Z")

</div>

Hi experts,  
I am using TMVA to do classification training with Signal and Background events from separate root file (with preselection cut so that I ended up with more signal than background, see the training output below).

```auto
                         : Number of training and testing events
                         : ---------------------------------------------------------------------------
                         : Signal -- training events : 1295451
                         : Signal -- testing events : 1295451
                         : Signal -- training and testing events: 2590902
                         : Background -- training events : 175046
                         : Background -- testing events : 175046
                         : Background -- training and testing events: 350092
                         : Dataset[dataset] : Background -- due to the preselection a scaling factor has been applied to the numbers of requested events: 0.135124

```

when it come to the training stage, i am expecting 350092 events for both signal and background. but it turned out that the events used is almost 2 times from what i have expected.

```auto
#events: (reweighted) sig: 735248 bkg: 735248
#events: (unweighted) sig: 1295451 bkg: 175046

```

My question is that how TMVA factory do the rewieigth on those events?  
am i getting duplicated events for my background?  
Also, I would like to ask what is weight and its purpose in TMVA’s training.  
Thanks.

* * *

\_ROOT Version: 6.24 (PyROOT via conda)  
\_Platform:Centos7  
\_Compiler: gcc9

* * *

---

<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:** [June 18, 2022, 2:18pm UTC](https://root-forum.cern.ch/t/reweight-in-tmvas-bdt/50466/2 "2022-06-18T14:18:10Z")

</div>

Hi,

You are using probably the default `NormMode=EqualNumEvents` in the DataLoader::PrepareTrainingAndTestTree. See page 21 and following table at page 22 of the [TMVA Users Guide](https://root.cern.ch/download/doc/tmva/TMVAUsersGuide.pdf).

Lorenzo
