# R Learner node with 2 input ports (Training and Validation)

**URL:** <https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [February 14, 2017, 12:07pm UTC](https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648 "2017-02-14T12:07:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alfroc](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/d07c76/32.png) [@alfroc](https://forum.knime.com/u/alfroc)\
**Post date:** [February 14, 2017, 12:07pm UTC](https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648/1 "2017-02-14T12:07:54Z")

</div>

Hi,  
I’d like to minimize the generalization error by pruning a decision tree using a validation set.  
I know that Knime actually doesn’t support this feature. So I thought to configure a R Node like the R Learner,&nbsp;but with two input ports:&nbsp;one for the training set and one for the validation set. Is there any way to accomplish that?  
Maybe the attached picture can explain better the question.  
Thanks!  
Alfredo

---

<div class="post-metadata">

**Author:** ![unknown\_user](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/u/ac91a4/32.png) [@unknown\_user](https://forum.knime.com/u/unknown_user)\
**Post date:** [February 14, 2017, 11:39pm UTC](https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648/2 "2017-02-14T23:39:41Z")

</div>

Hi,

Somthing llike the picture in attachment should work.

- [train\_test.png](https://www.knime.com/sites/default/files/train_test.png)

---

<div class="post-metadata">

**Author:** ![alfroc](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/d07c76/32.png) [@alfroc](https://forum.knime.com/u/alfroc)\
**Post date:** [February 15, 2017, 5:42pm UTC](https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648/3 "2017-02-15T17:42:10Z")

</div>

It works, great!

Thank you very much, Fabienc!

Alfredo

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 2, 2023, 9:31pm UTC](https://forum.knime.com/t/r-learner-node-with-2-input-ports-training-and-validation/3648/4 "2023-06-02T21:31:24Z")

</div>

Closed on June 2, 2023, 9:31pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
