# Using rdataframes in TMVA

**URL:** <https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569>\
**Category:** TMVA\
**Tags:** rdataframe\
**Created:** [August 22, 2024, 5:14pm UTC](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569 "2024-08-22T17:14:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottmar1054](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/scottmar1054/32/37326_2.png) [@scottmar1054](https://root-forum.cern.ch/u/scottmar1054)\
**Post date:** [August 22, 2024, 5:14pm UTC](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569/1 "2024-08-22T17:14:31Z")

</div>

I have a general question. How do I use an rdataframe as data input in TMVA? There is a tutorial for converting a rdataframe into an rtensor, but I don’t see any readily available information about inputting that rtensor into TMVA. Obviously, I could do a snapshot and write out the dataframe to a ttree and then use the ttree in TMVA, but I am looking for something else.

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [August 23, 2024, 6:57am UTC](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569/2 "2024-08-23T06:57:21Z")

</div>

Hi,

I add in the loop the TMVA expert, @moneta .

Cheers,  
D

---

<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 23, 2024, 7:51am UTC](https://root-forum.cern.ch/t/using-rdataframes-in-tmva/60569/3 "2024-08-23T07:51:22Z")

</div>

Hi,  
If you are using TMVA for evaluating a trained model you can use RDataFrame and its conversion to RTensor to provide input to the RReader class. (see this [tutorial](https://root.cern.ch/doc/master/tmva003__RReader_8C.html)).  
For training a model, there is no support from RDataFrame, you would need to create a TTree using the snapshot functionality of RDataFrame

Lorenzo
