BookmarkSubscribe
Choose Language Hide Translation Bar
ghartel
Community Trekker

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

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.

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

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

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
2 REPLIES 2
txnelson
Super User

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

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
aronwilson
Community Trekker

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

This worked great by the way. I was able to use this in a script to quickly general validation columns stratified by another column.

0 Kudos