Hi
I think there is a "Make Validation Column" function in JMP pro but I am wondering how to make a validation column (with 25% training and 75% validation) using JSL in regular JMP? Any help is appreciated.
It is pretty simple to do interactively. The JSL steps should be straight-forward using this approach, too.
Create a columns called Validation.
Fill the entire column with 0s. A zero will indicate a training set observation.
Go to Tables > Subset.
Enter a Random-Sampling Rate of 0.75 (for your 75% validation set).
Check the box for Link to Original Data Table.
Click OK.
In the subset table, change a validation field from 0 to 1.
Right-click the 1 and Fill to end of Table.
Close the subset table.
I was pretty loose with my JSL (didn't bother with proper scoping to avoid potential issues), but it should give you a pretty good start.
dt=Current Data Table();
dt << New Column( "Validation",
Numeric,
"Nominal",
Format( "Best", 12 )
);
For Each Row (:Validation = 0);
dt << Subset(
Output Table("ValData"),
Linked,
Suppress formula evaluation( 0 ),
Sampling Rate( 0.75 ),
Selected columns only( 0 )
);
For Each Row (:Validation = 1);
Close( "ValData" );
dt << Clear Select;
Note that this is going strictly with a random assignment. Many times you really should stratify the validation by the target variable.