← All nodes
Analytics

Train/Test Split

Sends a random share of the rows out of the Test pin and the rest out of Train, reproducibly from a seed, and labels each row in a Split column.

When to use it

Use it before fitting a model: fit on the Train rows, then check the model on Test rows it has not seen.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
Test share (0–1)number—0.2
Seednumber—1
Keep the proportions ofselect—Optional: a class column
Split column nametext—Default: Split

Example

Hold out 40%

  • Test share (0–1)=0.4
  • Seed=1
Rows
Id
1
2
3
4
5
Every row labelled; rows 2 and 4 leave by the Test pin
IdSplit
1Train
2Test
3Train
4Test
5Train

Worth knowing

  • Exactly round(rows × share) rows go to Test; the same seed always picks the same rows. A connection without a pin label takes Train.
  • Keep the proportions of draws the share within each value of a class column, so a rare class appears on both pins.
  • Want every row in one table? Connect both pins to Union Rows — the Split column says which part each row is in.

Others in Analytics