# How to give a tree to the factory as a training tree when using Regression?

**URL:** <https://root-forum.cern.ch/t/how-to-give-a-tree-to-the-factory-as-a-training-tree-when-using-regression/40534>\
**Category:** TMVA\
**Created:** [July 20, 2020, 8:55pm UTC](https://root-forum.cern.ch/t/how-to-give-a-tree-to-the-factory-as-a-training-tree-when-using-regression/40534 "2020-07-20T20:55:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [July 20, 2020, 8:55pm UTC](https://root-forum.cern.ch/t/how-to-give-a-tree-to-the-factory-as-a-training-tree-when-using-regression/40534/1 "2020-07-20T20:55:25Z")

</div>

How to give a tree to the factory as a training tree when using Regression?  
I didn’t find the option for doing that

---

<div class="post-metadata">

**Author:** ![cxwx1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/cxwx1/32/22433_2.png) [@cxwx1](https://root-forum.cern.ch/u/cxwx1)\
**Post date:** [July 20, 2020, 9:03pm UTC](https://root-forum.cern.ch/t/how-to-give-a-tree-to-the-factory-as-a-training-tree-when-using-regression/40534/2 "2020-07-20T21:03:02Z")

</div>

I’m sorry, I didn’t see the code clearly, solution like below

```auto
dataloader->AddRegressionTree(tTrain,1.0,Types::kTraining);

```
