# Training TMVA with different signal/background variable names

**URL:** <https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656>\
**Category:** TMVA\
**Created:** [April 29, 2021, 7:16pm UTC](https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656 "2021-04-29T19:16:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jruizvid](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@jruizvid](https://root-forum.cern.ch/u/jruizvid)\
**Post date:** [April 29, 2021, 7:16pm UTC](https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656/1 "2021-04-29T19:16:05Z")

</div>

Is it possible to train a classifier using two tuples (signal/background, MC/data) that have different variable names? For example, some variables are called `PIDx` in background, and `PIDx_corr` in the signal tree.

I guess I’m imagining something like [TMVA::DataLoader::AddVariable](https://root.cern.ch/doc/v612/classTMVA_1_1DataLoader.html#a032f74dc0b09a01588661717935f848c) with two `TString expression` arguments. But any workaround (without renaming the variables in the (large) tuples) would do. Thanks!

---

<div class="post-metadata">

**Author:** ![jalopezg](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jalopezg/32/25844_2.png) [@jalopezg](https://root-forum.cern.ch/u/jalopezg)\
**Post date:** [April 29, 2021, 7:59pm UTC](https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656/2 "2021-04-29T19:59:15Z")

</div>

Hi @jruizvid; I am sure @moneta has the answer to your question.

Cheers,  
J.

---

<div class="post-metadata">

**Author:** ![jruizvid](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/53a042/32.png) [@jruizvid](https://root-forum.cern.ch/u/jruizvid)\
**Post date:** [May 4, 2021, 10:38am UTC](https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656/3 "2021-05-04T10:38:56Z")

</div>

Anybody knows if this is possible?  
(reminder after few days with no answer)

---

<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:** [May 4, 2021, 12:48pm UTC](https://root-forum.cern.ch/t/training-tmva-with-different-signal-background-variable-names/44656/4 "2021-05-04T12:48:47Z")

</div>

Hi,  
No this is not possible, variable must have the same name, because what then will be called when using the trained method in the real un-labeled data ?  
There is an easy solution, create a snapshot of the original tree with the variables renamed.

Lorenzo
