Subscribe Bookmark RSS Feed

JSL: how can you script make a validation column using stratified random

ghartel

Occasional Contributor

Joined:

Mar 5, 2017

I want to create a validation column using stratified random in JSL, but it doesn't seem to let me incldue the column name for stratification:

Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	Stratified Random(:Group)
);

 

this brings up a column selection dialog.  I cant find documentation how to specify the column in JSL code.

1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

I played around with the Make Validation Column object, and as you indicated, I could not make the Stratified Random work without having the column selection window come up.  However, I was able to add a By() element into the script and it may work for what you want:

Names Default To Here( 1 );
dt = Current Data Table();
dt << Make Validation Column(
	Training Set( 0.50 ),
	Validation Set( 0.25 ),
	Test Set( 0.25 ),
	formula random,
	by( :group )
);
Jim