# About running TMVA on different OS

**URL:** <https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232>\
**Category:** TMVA\
**Created:** [January 10, 2019, 7:02am UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232 "2019-01-10T07:02:48Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [January 10, 2019, 7:02am UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/1 "2019-01-10T07:02:48Z")

</div>

Dear Sir,

I had run with TMVA BDT with the configure as  
NTrees=800:MinNodeSize=2.5%:MaxDepth=4:BoostType=AdaBoost:AdaBoostBeta=0.5:UseBaggedBoost:BaggedSampleFraction=0.5:SeparationType=GiniIndex:nCuts=20

I got different BDT response shape from two OS.

May I ask usually its normal? And how can we estimate uncertainty?

Thanks!

Best,  
Jung

 ![Snip20190110_66](https://root-forum.cern.ch/uploads/default/original/3X/0/a/0a0e52a3d6126ab3349964c276914a761d68ad0f.png)

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [January 10, 2019, 7:55am UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/2 "2019-01-10T07:55:05Z")

</div>

Small differences are definitely possible, since there are many things that can be different between OSs, for example, math function implementations in the standard C library, rounding mode for floating point numbers, the system compiler (GCC / Clang), default compilation flags (in particular optimization options), etc. However, since the background test sample looks different in the two plots, I think the difference could be due something like using a different random seed somewhere for the calculations, for example, for selecting what is part of the test and training samples. Cheers,

---

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [January 10, 2019, 1:01pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/3 "2019-01-10T13:01:00Z")

</div>

Dear Amadio,

Thanks for the reply.  
We use this setting to separate test and train sample, nTrain\_Signal=0:nTrain\_Background=0:SplitMode=Random:NormMode=None

Is it means the BDT output is highly depend on these?

p.s. if I train many times on same system the output is similar.

Best,  
Jung

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [January 10, 2019, 1:02pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/4 "2019-01-10T13:02:38Z")

</div>

> [@JungChang](#):
>
> SplitMode=Random

I think this is what is causing variation between the runs.

---

<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:** [January 10, 2019, 1:55pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/5 "2019-01-10T13:55:17Z")

</div>

Hi,

As @amadio is saying, `SplitMode=Random` activates random splitting of the data. The seed of the splitting is controlled with `SplitSeed=100`. (The default is 100).

To determine whether it’s the random splitting causing the difference I would ask you to rerun the training with `SplitMode=Alternate` or `SplitMode=Block`. These two modes are not recommended for trainings used in production, but should be good for determining the cause here.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [January 10, 2019, 2:07pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/6 "2019-01-10T14:07:33Z")

</div>

Dear Kim,

Thanks for the reply, I will try.

I have another question, is it mean the BDT is sensitive even to the random seed?

Then how can I decide the BDT result uncertainty?

Thanks!

Best,  
Justine

---

<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:** [January 10, 2019, 3:35pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/7 "2019-01-10T15:35:28Z")

</div>

The BDT _training_ is sensitive to the random seed yes. In application the results should be identical barring subtle differences in the floating-point implementation etc.

To determine the uncertainty of the BDT response one can use cross validation. The idea is then to train the classifier repeatedly using (slightly) different training and test samples. This will give several reasonably independent distributions of the response with which one can derive some measures of uncertainty.

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [January 10, 2019, 4:21pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/8 "2019-01-10T16:21:13Z")

</div>

Dear Kim,

Thanks for the reply, I got it.

Best,

Justine

Kim Albertsson [root.discourse@cern.ch](mailto:root.discourse@cern.ch)於 2019年1月10日 週四，下午11:45寫道：

---

<div class="post-metadata">

**Author:** ![JungChang](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/3e96dc/32.png) [@JungChang](https://root-forum.cern.ch/u/JungChang)\
**Post date:** [January 14, 2019, 3:10am UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/9 "2019-01-14T03:10:26Z")

</div>

Dear Kim,

We tested the Splitmode as you suggested as the attached file Left is Linux system, Right is OS X system.  
Only the Random mode shown difference. Will it due to number of events not enough so the statistic fluctuation is high?

Tanks,

Best,  
Jung

 ![Selection_071](https://root-forum.cern.ch/uploads/default/original/3X/c/1/c15d9e70faa09cb960492d26af546b81af981e9a.png)

---

<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:** [January 14, 2019, 2:56pm UTC](https://root-forum.cern.ch/t/about-running-tmva-on-different-os/32232/10 "2019-01-14T14:56:04Z")

</div>

Hi,

I’m not sure I exactly understand the question but basically that there is variance across trainings on different machines is not a _major_ issue. As long as the application phase produces identical values across different machines that is enough (train once and then you should be able to trust that output).

If I understand your question correctly, then yes the differences should go away as your data sample size is increased.

Maybe @moneta wants to add something to this discussion.

Cheers,  
Kim
