# TMVA::Reader prediction

**URL:** <https://root-forum.cern.ch/t/tmva-reader-prediction/46131>\
**Category:** TMVA\
**Tags:** hist, tmva\
**Created:** [August 2, 2021, 6:21pm UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131 "2021-08-02T18:21:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PasqualeAndreola](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pasqualeandreola/32/23098_2.png) [@PasqualeAndreola](https://root-forum.cern.ch/u/PasqualeAndreola)\
**Post date:** [August 2, 2021, 6:21pm UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131/1 "2021-08-02T18:21:15Z")

</div>

Hi to everybody. I would like to use TMVA to “reshape” the background into the signal.

At the moment, I am using the classical approach: I am evaluating the TMVA Method result with  
`reader->EvaluateMVA("method")` and selecting events above a given cut.  
What I would like to know is if it is possible to have weights that can change the shape of the background to the signal one. Let me rephrase it: I would like to know if there is something similar to the Keras “predict” method. I couldn’t find anything similar in TMVA documentation.

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:** [August 3, 2021, 3:30pm UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131/2 "2021-08-03T15:30:54Z")

</div>

Hi,

The return value of `reader->EvaluateMVA("method")` would be the same as when using `predict` in Keras.  
For BDT you can use the new `RReader::Compute` interface, see the tutorial  
[https://root.cern.ch/doc/master/tmva003\_\_RReader\_8C.html](https://root.cern.ch/doc/master/tmva003__RReader_8C.html)

Lorenzo

---

<div class="post-metadata">

**Author:** ![PasqualeAndreola](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pasqualeandreola/32/23098_2.png) [@PasqualeAndreola](https://root-forum.cern.ch/u/PasqualeAndreola)\
**Post date:** [August 3, 2021, 3:54pm UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131/3 "2021-08-03T15:54:41Z")

</div>

Thank you for the help, Lorenzo!

I’ll try to use the reader output as weights, then. Just a question: is this new `RReader::Compute` interface working with other MVA methods (e.g. MLP and DL)?

---

<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:** [August 4, 2021, 7:29am UTC](https://root-forum.cern.ch/t/tmva-reader-prediction/46131/4 "2021-08-04T07:29:22Z")

</div>

Ciao Pasquale,

This new interface, `RReader` should work also for the pother TMVA methods, since it uses internally the old `TMVA::Reader` class. If you have any issue using it with other methods, please let me know

Cheers

Lorenzo
