I put together this simple script to divide a data table into training, test and validation subsets, by creating row state columns.
I then have one line of code at the end meant to copy the row states from the 'Training set' row state column.
The weird thing is that if I run the whole script, row states are not copied. If I run everything but the last line first, and then the last line separately, then it works.
Any ideas on how to fix this? Am I missing something or is it a bug?
Thanks!
New Column( "Random", Numeric, Formula( Random Uniform() ) );
New Column( "Data Set Indicator",
Character,
Formula( If( :Random <= 0.6, "Training", 0.6 < :Random <= 0.8, "Validation", "Test" ) )
);
New Column( "Training set",
Row State,
set formula(
Combine States(
Excluded State( :"Data Set Indicator" != "Training" ),
Hidden State( :"Data Set Indicator" != "Training" )
)
)
);
New Column( "Validation set",
Row State,
set formula(
Combine States(
Excluded State( :"Data Set Indicator" != "Validation" ),
Hidden State( :"Data Set Indicator" != "Validation" )
)
)
);
New Column( "Test set",
Row State,
set formula(
Combine States(
Excluded State( :"Data Set Indicator" != "Test" ),
Hidden State( :"Data Set Indicator" != "Test" )
)
)
);
Column( "Training set" ) << Copy to row states();