# Getting a single ROC curve for multiple BDT trees

**URL:** <https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654>\
**Category:** TMVA\
**Created:** [February 22, 2021, 12:49pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654 "2021-02-22T12:49:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rithishbarath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rithishbarath/32/23840_2.png) [@rithishbarath](https://root-forum.cern.ch/u/rithishbarath)\
**Post date:** [February 22, 2021, 12:49pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/1 "2021-02-22T12:49:47Z")

</div>

Dear members,  
I would like to get a single ROC curve which compares different number of trees . Look at the attached image for example. What modifications should i do in the TMVA CLASSIFICATION.C file to get this type of roc curve. Is there any other specific way to get ROC curves like i had mentioned

 ![Screenshot from 2021-02-22 18-18-19](https://root-forum.cern.ch/uploads/default/original/3X/3/c/3c7e03d2d95d9e47415251420a14a2878a2bba1f.png) ?

Thank you

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [February 23, 2021, 12:52pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/2 "2021-02-23T12:52:01Z")

</div>

May be @moneta has an idea.

---

<div class="post-metadata">

**Author:** ![rithishbarath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rithishbarath/32/23840_2.png) [@rithishbarath](https://root-forum.cern.ch/u/rithishbarath)\
**Post date:** [March 2, 2021, 4:19pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/3 "2021-03-02T16:19:11Z")

</div>

@moneta Kindly help me with this

---

<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:** [March 2, 2021, 10:04pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/4 "2021-03-02T22:04:28Z")

</div>

Hello,  
Let me understand this better, would you like to get a single plot where you have multiple ROC curve made with BDT varying the number of trees used, like in the image above ?  
This is easy, you need to book in the macro like TMVAClassification.C different BDT method, each giving a different name, where you use as parameter different number of trees.  
If it is not clear I can provide you an example

Cheers

Lorenzo

---

<div class="post-metadata">

**Author:** ![rithishbarath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rithishbarath/32/23840_2.png) [@rithishbarath](https://root-forum.cern.ch/u/rithishbarath)\
**Post date:** [March 3, 2021, 2:48am UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/5 "2021-03-03T02:48:11Z")

</div>

@moneta sir. You have exactly understood my point. I need the same output which you have mentioned. Let me make it more clear . I need ROC curves for different number of trees, but the same BDT method. Not for different types of BDT methods like gradient boost, adaptive boost etc. Kindly give me an example as you have mentioned (with code) so that it helps me. Thank you

---

<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:** [March 3, 2021, 8:43am UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/6 "2021-03-03T08:43:59Z")

</div>

Hi,  
Here is a macro similar to TMVAClassification.C, that trains a set of different BDT with a number of trees.  
It will open a TMVAGUI at the end and by clicking on the `(5b)` button, you will get the ROC curve plot.

Cheers

Lorenzo

[TMVAClassificationBDT.C](https://root-forum.cern.ch/uploads/short-url/92sxdCAgqXKrlCWeZrvaLozH7YX.C) (10.7 KB)

---

<div class="post-metadata">

**Author:** ![rithishbarath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rithishbarath/32/23840_2.png) [@rithishbarath](https://root-forum.cern.ch/u/rithishbarath)\
**Post date:** [March 3, 2021, 2:00pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/7 "2021-03-03T14:00:19Z")

</div>

Thank you @moneta sir. I couldn’t find this file in tutorials folder. If any repository exists kindly send the link for that repository. Thank you

---

<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:** [March 3, 2021, 2:33pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/8 "2021-03-03T14:33:44Z")

</div>

Hi,  
There is a file attached to the previous post, **TMVAClassificationBDT.C**.  
Can you download it ?

---

<div class="post-metadata">

**Author:** ![rithishbarath](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/rithishbarath/32/23840_2.png) [@rithishbarath](https://root-forum.cern.ch/u/rithishbarath)\
**Post date:** [March 3, 2021, 3:31pm UTC](https://root-forum.cern.ch/t/getting-a-single-roc-curve-for-multiple-bdt-trees/43654/9 "2021-03-03T15:31:36Z")

</div>

Yes i can download it. Thank you very much.
