<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/618887#M81825</link>
    <description>&lt;P&gt;Hi Thierry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion was in fact very close. You suggested building a 1x3 matrix when it needed a 3x1 matrix&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtstub= data table("test");

nrun=3;
nTraining = 0.75;
nVal = 0.25;

// Create the matrix
mat = J(3,1, {.}); // 1x3 matrix with missing values

mat [1,1] = nTraining;
mat [2,1] = nVal;
mat [3,1] = 0;

show (mat);

For( i = 1, i &amp;lt;= nrun, i++,
	data table("test") &amp;lt;&amp;lt;	

New Column( "Val",
	Numeric,
	"Nominal",
	Format( "Best", 12 ),
	Formula(
		EVal (Eval Expr (Make Validation Formula(
		expr(mat),
		//	[0.75, 0.25, 0],
			&amp;lt;&amp;lt;Stratification Columns( :basic_class )
		)
	))),
	Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
	Use Value Labels( 1 )
)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 31 Mar 2023 19:14:58 GMT</pubDate>
    <dc:creator>Sburel</dc:creator>
    <dc:date>2023-03-31T19:14:58Z</dc:date>
    <item>
      <title>Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617113#M81663</link>
      <description>&lt;P&gt;In the process of assessing the performance of ML model, I'm trying to create a UI that will specify the number of run the model will be doing and the specify the proportion of training and validation data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to pass that info into a for loop that will create the columns based on the number of run specified and also to pass in the proportions. The loop works fine when I specify the proportion (second example) but not when using variables (nTraining, nVal).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some suggestions would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtsub=New Table( "test",
	Add Rows( 34 ),
	New Column( "test_article",
		Character( 7 ),
		"Nominal",
		Set Values(
			{"1269442", "1100729", "1269449", "1269448", "1100723", "1100728",
			"1269456", "1269457", "1269458", "1269454", "1269468", "1269469",
			"1269466", "1269471", "1100397", "1100405", "1100406", "1100407",
			"1100528", "1100534", "1100535", "1100540", "1100542", "1100566",
			"1100585", "1100590", "1100725", "1100873", "1100914", "1100915",
			"1100920", "1100990", "1100991", "1101101"}
		),
		Set Display Width( 61 )
	),
	New Column( "basic_class",
		Character,
		"Nominal",
		Set Values(
			{"0_Active", "0_Active", "0_Active", "0_Active", "0_Active", "0_Active",
			"0_Active", "0_Active", "0_Active", "0_Active", "0_Active", "0_Active",
			"1_MarginalActive", "1_MarginalActive", "1_MarginalActive",
			"1_MarginalActive", "1_MarginalActive", "1_MarginalActive", "2_Inactive",
			"1_MarginalActive", "2_Inactive", "1_MarginalActive", "2_Inactive",
			"1_MarginalActive", "1_MarginalActive", "1_MarginalActive", "0_Active",
			"1_MarginalActive", "0_Active", "0_Active", "2_Inactive", "0_Active",
			"0_Active", "0_Active"}
		),
		Set Display Width( 90 )
	),
	Set Row States(
		[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1,
		1, 0, 1, 0, 0, 0, 0, 0, 0]
	)
);

nrun=10;
//the proportion forthe valdation column are specified here
nTraining = 0.75;
nVal = 0.25;

//getting this error 
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], &amp;lt;&amp;lt;St...
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 1 ),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( Make Validation Formula( [nTraining, nVal, 0], &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	)
);



//specifiying the proportions works fine 
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 1 ),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( Make Validation Formula( [0.75, 0.25, 0], &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:06:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617113#M81663</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2023-06-09T16:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617203#M81670</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think you need to specify the matrix in your last New Column statement (see below). I could not test it because your script has other errors.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nrun=10;
nTraining = 0.75;
nVal = 0.25;

mat = J(1,3);

mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;


//getting this error 
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], &amp;lt;&amp;lt;St...
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 1 ),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( Make Validation Formula(mat), &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2023 22:06:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617203#M81670</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-03-27T22:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617204#M81671</link>
      <description>&lt;P&gt;SOrry for the typo in the JSL script. Here is the correct syntax.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nrun=10;
nTraining = 0.75;
nVal = 0.25;

mat = J(1,3);

mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;


//getting this error 
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], &amp;lt;&amp;lt;St...
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 1 ),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( Make Validation Formula(mat, &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	)
);	
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2023 22:11:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617204#M81671</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-03-27T22:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617210#M81673</link>
      <description>&lt;P&gt;Sorry again, I tried to answer too quickly. I do not have the right version of JMP to test the issue, but I think I solved the problem.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nrun=10;
nTraining = 0.75;
nVal = 0.25;

mat = J(1,3);

mat [1,1] = nTraining;
mat [1,2] = nVal;
mat [1,3] = 0;


//getting this error 
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], &amp;lt;&amp;lt;St...
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 0),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( EVal (Eval Expr (Make Validation Formula(Expr (mat), &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ))),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	)
);	&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2023 22:16:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617210#M81673</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-03-27T22:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617567#M81711</link>
      <description>&lt;P&gt;Hi Thierry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion. Unfortunately,&amp;nbsp; it does not seem to work. Your suggestion results in a matrix without comma separation. The formula requires a comma-separated matrix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 18:06:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617567#M81711</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2023-03-28T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617633#M81715</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;For the sake of exploring all avenues, have you tried to generate transposed matrix?&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nTraining = 0.75;
nVal = 0.25;

mat = J(3,1);

show (mat);

mat [1,1] = nTraining;
mat [2,1] = nVal;
mat [3,1] = 0;

show (mat);

//getting this error 
//Invalid matrix token.
//Line 232 Column 38: ...ake Validation Formula( [►nTraining, nVal, 0], &amp;lt;&amp;lt;St...
For( i = 1, i &amp;lt;= nrun, i++,
	dtsub &amp;lt;&amp;lt; New Column( "Testing",
		&amp;lt;&amp;lt;Hide( 0),
		Numeric,
		"Nominal",
		Format( "Best", 12 ),
		Formula( Eval (Eval Expr (Make Validation Formula(Expr (mat), &amp;lt;&amp;lt;Stratification Columns( :basic_class ) ) ))),
		Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
		Use Value Labels( 1 )
	)
);	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I cannot tell if the formula will be accepted because I don't have JMP Pro available, but at least, it generates a Comma-delimited matrix in the Formula.&lt;/P&gt;
&lt;P&gt;Sorry for not being of greater help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;TS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 00:11:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617633#M81715</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-03-29T00:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617850#M81732</link>
      <description>&lt;P&gt;I'll give it a shot and thanks for giving it a shot&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 14:51:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/617850#M81732</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2023-03-29T14:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Error trying to create validation columns when trying to pass a variable in the proportion matrix</title>
      <link>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/618887#M81825</link>
      <description>&lt;P&gt;Hi Thierry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion was in fact very close. You suggested building a 1x3 matrix when it needed a 3x1 matrix&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtstub= data table("test");

nrun=3;
nTraining = 0.75;
nVal = 0.25;

// Create the matrix
mat = J(3,1, {.}); // 1x3 matrix with missing values

mat [1,1] = nTraining;
mat [2,1] = nVal;
mat [3,1] = 0;

show (mat);

For( i = 1, i &amp;lt;= nrun, i++,
	data table("test") &amp;lt;&amp;lt;	

New Column( "Val",
	Numeric,
	"Nominal",
	Format( "Best", 12 ),
	Formula(
		EVal (Eval Expr (Make Validation Formula(
		expr(mat),
		//	[0.75, 0.25, 0],
			&amp;lt;&amp;lt;Stratification Columns( :basic_class )
		)
	))),
	Value Labels( {0 = "Training", 1 = "Validation", 2 = "Test"} ),
	Use Value Labels( 1 )
)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Mar 2023 19:14:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Error-trying-to-create-validation-columns-when-trying-to-pass-a/m-p/618887#M81825</guid>
      <dc:creator>Sburel</dc:creator>
      <dc:date>2023-03-31T19:14:58Z</dc:date>
    </item>
  </channel>
</rss>

