# TMVA training splitmode

**URL:** <https://root-forum.cern.ch/t/tmva-training-splitmode/20212>\
**Category:** TMVA\
**Created:** [November 17, 2015, 9:04am UTC](https://root-forum.cern.ch/t/tmva-training-splitmode/20212 "2015-11-17T09:04:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![annabie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@annabie](https://root-forum.cern.ch/u/annabie)\
**Post date:** [November 17, 2015, 9:04am UTC](https://root-forum.cern.ch/t/tmva-training-splitmode/20212/1 "2015-11-17T09:04:34Z")

</div>

Good morning guys,  
I’m actually new and I’m trying to make a BDT in root. (I usually use R, but I have to compare my R-models with the BDT output of root). My problem is that i want to save (in some way) the data that the algorithm use in the training and maybe also the events used in the test step, in order to train my models in R and root with the same train and test sets. I was thinking about the splitmode= Random in `factory->PrepareTrainingAndTestTree("", "!V:nTrain_Signal=25000:nTrain_Background=25000:nTest_Signal=8000:nTest_Background=8000:SplitMode=Random");` that has the seed 100. But how can I get this events and maybe create a txt file or a tree? I don’t know if my question is clear. I hope you can help me. Thank you. \<3

---

<div class="post-metadata">

**Author:** ![annabie](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/85e7bf/32.png) [@annabie](https://root-forum.cern.ch/u/annabie)\
**Post date:** [November 17, 2015, 5:15pm UTC](https://root-forum.cern.ch/t/tmva-training-splitmode/20212/2 "2015-11-17T17:15:48Z")

</div>

I’ve solved my problem. 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:** [November 19, 2015, 1:17pm UTC](https://root-forum.cern.ch/t/tmva-training-splitmode/20212/3 "2015-11-19T13:17:49Z")

</div>

HI,

In case you don’t know you can now use directly R methods with ROOT and TMVA.  
See [oproject.org/tiki-index.php?page … rs%20Guide](http://oproject.org/tiki-index.php?page=ROOT%20R%20Users%20Guide)  
and [oproject.org/tiki-index.php?page=RMVA](http://oproject.org/tiki-index.php?page=RMVA)

Lorenzo
