# TMVA define train and test samples from differente files

**URL:** <https://root-forum.cern.ch/t/tmva-define-train-and-test-samples-from-differente-files/12990>\
**Category:** TMVA\
**Created:** [August 25, 2011, 9:28pm UTC](https://root-forum.cern.ch/t/tmva-define-train-and-test-samples-from-differente-files/12990 "2011-08-25T21:28:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cicciodevoto](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/db5fbb/32.png) [@cicciodevoto](https://root-forum.cern.ch/u/cicciodevoto)\
**Post date:** [August 25, 2011, 9:28pm UTC](https://root-forum.cern.ch/t/tmva-define-train-and-test-samples-from-differente-files/12990/1 "2011-08-25T21:28:55Z")

</div>

Hi all,

I have a problem with TMVA and I tried to use the search but, apparently, I did not find anything.

I need to select the train and test events for signal and background from different files; I mean I have 1 file for Train Signal, 1 for Test Signal, 1 for Train Bkg and 1 for Test Bkg.

Is it possible to do it? Because until now I always used 1 file for Signal and 1 for Bkg, and from these 2 files I took the events for Train and Test.

I am using TMVA 4.1.0 with root 5.28/00e

Thank you very much  
Ciccio

---

<div class="post-metadata">

**Author:** ![cicciodevoto](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/db5fbb/32.png) [@cicciodevoto](https://root-forum.cern.ch/u/cicciodevoto)\
**Post date:** [September 7, 2011, 9:07pm UTC](https://root-forum.cern.ch/t/tmva-define-train-and-test-samples-from-differente-files/12990/2 "2011-09-07T21:07:02Z")

</div>

Hi all,

I want to specify my problem.  
From the TMVA user guide, I read:

[quote]The input events that are handed to the Factory are internally copied and split into one training and  
one test ROOT tree.  
[/quote]

Can I force this part using a cut or some other thing?  
I would like to have the test and training samples with same particular characteristics.

Thank you  
Ciccio

---

<div class="post-metadata">

**Author:** ![cicciodevoto](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/db5fbb/32.png) [@cicciodevoto](https://root-forum.cern.ch/u/cicciodevoto)\
**Post date:** [September 8, 2011, 3:23pm UTC](https://root-forum.cern.ch/t/tmva-define-train-and-test-samples-from-differente-files/12990/3 "2011-09-08T15:23:01Z")

</div>

Hi all,

I found the solution to my problem.  
If also some other people has the same problems the solution is in the file:

$ROOTSYS/tmva/test/TMVAClassification.cxx

😃😃😃

Bye  
Ciccio
