# Difference between TMVA and Scikit-learn

**URL:** <https://root-forum.cern.ch/t/difference-between-tmva-and-scikit-learn/56492>\
**Category:** TMVA\
**Created:** [September 26, 2023, 7:37am UTC](https://root-forum.cern.ch/t/difference-between-tmva-and-scikit-learn/56492 "2023-09-26T07:37:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orestiskonsta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/orestiskonsta/32/34589_2.png) [@orestiskonsta](https://root-forum.cern.ch/u/orestiskonsta)\
**Post date:** [September 26, 2023, 7:37am UTC](https://root-forum.cern.ch/t/difference-between-tmva-and-scikit-learn/56492/1 "2023-09-26T07:37:34Z")

</div>

Hello root developers,  
Is there any particular difference between the implementation of Adaptive Boosting of TMVA and that of scikit-learn?  
I am applying the same algorithm with the same parameters to the same dataset and I get very different results.  
The parameters I am using are:  
NTrees=1200 MinNodeSize=1.0 BoostType=AdaBoost AdaBoostBeta=0.02 SeparationType=GiniIndex nCuts=14 MaxDepth=6  
Here we see the score histograms for the two classes. You can ignore the green line.  
TMVA AdaBoost  
 ![ada_boostTMVA](https://root-forum.cern.ch/uploads/default/original/3X/3/d/3d8b5a7eb6c5d43359c45c173bb2a718899e1216.png)

Scikit-learn AdaBoostClassifier  
 ![ada_boost](https://root-forum.cern.ch/uploads/default/original/3X/6/e/6e337ea9f44912e5dbf013f579f583bd4536a244.png)

---

<div class="post-metadata">

**Author:** ![jonas](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jonas/32/24756_2.png) [@jonas](https://root-forum.cern.ch/u/jonas)\
**Post date:** [September 26, 2023, 3:16pm UTC](https://root-forum.cern.ch/t/difference-between-tmva-and-scikit-learn/56492/2 "2023-09-26T15:16:38Z")

</div>

Welcome to the ROOT forum, @orestiskonsta!

Maybe the difference is just a simple transformation of the output? It seems a bit like this, because even the range on the x-axis is different.

Can you maybe produce a scatterplot of the TMVA ouput vs. the sklearn output for every given sample? If all the dots lie on a line, then it can give you a hint on the difference between the outputs.

Cheers,  
Jonas

---

<div class="post-metadata">

**Author:** ![orestiskonsta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/orestiskonsta/32/34589_2.png) [@orestiskonsta](https://root-forum.cern.ch/u/orestiskonsta)\
**Post date:** [September 27, 2023, 12:33pm UTC](https://root-forum.cern.ch/t/difference-between-tmva-and-scikit-learn/56492/3 "2023-09-27T12:33:50Z")

</div>

Hello Jonas,  
first of all thank you for the quick response.  
I tried what you proposed and here is what I got.  
It seems like there is an inverse sigmoid missing from tmva implementation!!

![sci-tmva-m](https://root-forum.cern.ch/uploads/default/original/3X/0/a/0ab060493f997865e649ee1b285e98bf671480c4.png)

![sci-tmva-n](https://root-forum.cern.ch/uploads/default/original/3X/b/6/b6712d5cb12f56b5c650b74c4552e82145085be0.png)

![sci-tmva](https://root-forum.cern.ch/uploads/default/original/3X/4/6/46c7dbfff59777b0e6c103ad6efe282a580361f3.png)
