<?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: Setting desirability in a neural net loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/361388#M61099</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16391"&gt;@shampton82&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Nice bit of code, and I like the idea of what you're intending to do with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; After trying out the code with the Diabetes data table, here's some feedback to help get you in the right direction, hopefully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. delete the pf= in the call for the NN platform. You can then define the pf = report(fit) later on as you want to maximize desirability.&lt;/P&gt;&lt;P&gt;2. if you send the command Set Desirabilities to pf, then a window comes up where you can manually enter maximize or minimize, but I don't see yet how to set it automatically with JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The below code works, but you have to manually edit the window. I'd like to know how to do it through JSL, though.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt=current datatable();


selCols = dt &amp;lt;&amp;lt; Get column names( String );



obj2=new window("Reponse Variable",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			LineupBox( NCol( 1 ), Spacing( 5 ),
				v list box(textbox("select response"),choseny = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ),
				 v list box(textbox("select validation"),chosenv = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ))
				)	
				),
			v list box(textbox("select predictors"),chosenx = ColListBox(dt,&amp;lt;&amp;lt;append(eval(selcols)),grouped ),),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

If( obj2["button"] == -1,
Throw();
);

y=eval(obj2[1]);
v=eval(obj2[2]);
x=eval(obj2[3]);

objy=eval(y)[1];




obj1=New Window( char(dt),V List Box(
	for(i=1, i &amp;lt;= 1, i++,
			if(i==1,
				t1=0;
				t2=0;
				l1=3;
				l2=3;
				b=0;,				
			i==2,	
				t1=0;
				t2=0;
				l1=10;
				l2=0;
				b=50;,
			i==3,
				t1=2;
				t2=1;
				l1=2;
				l2=3;
				b=0;,
			i==4,
				t1=1;
				t2=1;
				l1=4;
				l2=6;
				b=0;,
			i==5,
				t1=1;
				t2=0;
				l1=2;
				l2=3;
				b=0;,
			i==6,
				t1=10;
				t2=0;
				l1=0;
				l2=0;
				b=50;,
			i==7,
				t1=10;
				t2=0;
				l1=10;
				l2=0;
				b=50;
				
			);
			
			fit=Neural(
				Y( eval(y)),
				X(eval(x)),
				Validation( as column(dt, v[1]) ),
				Informative Missing( 0 ),
				Fit(
					NTanH( t1 ),
					NTanH2( t2 ),
					NLinear( l1 ),
					NLinear2( l2 ),
					Transform Covariates( 1 ),
					Robust Fit( 1 ),
					Number of Tours( 1 ),
					N Boost( B ),
					Learning Rate( 0.5 ),
					Profiler(
						1,
						Confidence Intervals( 1 ),
						Desirability Functions( 1 ),
						Independent Uniform Inputs( 1 ),
					),
					Plot Actual by Predicted( 0 ),
					Plot Residual by Predicted( 0 ),
				)
			);
			
			//set profiler to maximize here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			//set profiler to minimzie here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			
			//this is what i tried but is not working
			//column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Set Desirabilities;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			
			
			//column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Set Desirabilities;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			

		)
	
	)
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this at least gets you going in the right direction!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2021 15:45:27 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2021-02-22T15:45:27Z</dc:date>
    <item>
      <title>Setting desirability in a neural net loop</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/361217#M61080</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a script where I loop through different Neural net settings and as part of the looping I'd like to set the profile to maximize the desirability for a min goal and save the settings then do the same for a max goal as well.&amp;nbsp; I haven't been able to get this work work though.&amp;nbsp; Here is the script I am working with and I've been testing on the diabetes sample data set:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt=current datatable();


selCols = dt &amp;lt;&amp;lt; Get column names( String );



obj2=new window("Reponse Variable",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			LineupBox( NCol( 1 ), Spacing( 5 ),
				v list box(textbox("select response"),choseny = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ),
				 v list box(textbox("select validation"),chosenv = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ))
				)	
				),
			v list box(textbox("select predictors"),chosenx = ColListBox(dt,&amp;lt;&amp;lt;append(eval(selcols)),grouped ),),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

If( obj2["button"] == -1,
Throw();
);

y=eval(obj2[1]);
v=eval(obj2[2]);
x=eval(obj2[3]);

objy=eval(y)[1];




obj1=New Window( char(dt),V List Box(
	for(i=1, i &amp;lt;= 1, i++,
			if(i==1,
				t1=0;
				t2=0;
				l1=3;
				l2=3;
				b=0;,				
			i==2,	
				t1=0;
				t2=0;
				l1=10;
				l2=0;
				b=50;,
			i==3,
				t1=2;
				t2=1;
				l1=2;
				l2=3;
				b=0;,
			i==4,
				t1=1;
				t2=1;
				l1=4;
				l2=6;
				b=0;,
			i==5,
				t1=1;
				t2=0;
				l1=2;
				l2=3;
				b=0;,
			i==6,
				t1=10;
				t2=0;
				l1=0;
				l2=0;
				b=50;,
			i==7,
				t1=10;
				t2=0;
				l1=10;
				l2=0;
				b=50;
				
			);
			fit=Neural(
				Y( eval(y)),
				X(eval(x)),
				Validation( as column(dt, v[1]) ),
				Informative Missing( 0 ),
				Fit(
					NTanH( t1 ),
					NTanH2( t2 ),
					NLinear( l1 ),
					NLinear2( l2 ),
					Transform Covariates( 1 ),
					Robust Fit( 1 ),
					Number of Tours( 1 ),
					N Boost( B ),
					Learning Rate( 0.5 ),
					pf=Profiler(
						1,
						Confidence Intervals( 1 ),
						Desirability Functions( 1 ),
						Independent Uniform Inputs( 1 ),
					),
					Plot Actual by Predicted( 0 ),
					Plot Residual by Predicted( 0 ),
				)
			);
			
			//set profiler to maximize here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			//set profiler to minimzie here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			
			//this is what i tried but is not working
			column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			
			column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			

		)
	
	)
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The script will produce two separate saved settings but it is at the same state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any ideas!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:06:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/361217#M61080</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2023-06-09T22:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Setting desirability in a neural net loop</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/361388#M61099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16391"&gt;@shampton82&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Nice bit of code, and I like the idea of what you're intending to do with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; After trying out the code with the Diabetes data table, here's some feedback to help get you in the right direction, hopefully.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. delete the pf= in the call for the NN platform. You can then define the pf = report(fit) later on as you want to maximize desirability.&lt;/P&gt;&lt;P&gt;2. if you send the command Set Desirabilities to pf, then a window comes up where you can manually enter maximize or minimize, but I don't see yet how to set it automatically with JSL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The below code works, but you have to manually edit the window. I'd like to know how to do it through JSL, though.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt=current datatable();


selCols = dt &amp;lt;&amp;lt; Get column names( String );



obj2=new window("Reponse Variable",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			LineupBox( NCol( 1 ), Spacing( 5 ),
				v list box(textbox("select response"),choseny = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ),
				 v list box(textbox("select validation"),chosenv = ColListBox( dt, all, &amp;lt;&amp;lt;Set Data Type( "Numeric" ) ,grouped ))
				)	
				),
			v list box(textbox("select predictors"),chosenx = ColListBox(dt,&amp;lt;&amp;lt;append(eval(selcols)),grouped ),),
			H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

If( obj2["button"] == -1,
Throw();
);

y=eval(obj2[1]);
v=eval(obj2[2]);
x=eval(obj2[3]);

objy=eval(y)[1];




obj1=New Window( char(dt),V List Box(
	for(i=1, i &amp;lt;= 1, i++,
			if(i==1,
				t1=0;
				t2=0;
				l1=3;
				l2=3;
				b=0;,				
			i==2,	
				t1=0;
				t2=0;
				l1=10;
				l2=0;
				b=50;,
			i==3,
				t1=2;
				t2=1;
				l1=2;
				l2=3;
				b=0;,
			i==4,
				t1=1;
				t2=1;
				l1=4;
				l2=6;
				b=0;,
			i==5,
				t1=1;
				t2=0;
				l1=2;
				l2=3;
				b=0;,
			i==6,
				t1=10;
				t2=0;
				l1=0;
				l2=0;
				b=50;,
			i==7,
				t1=10;
				t2=0;
				l1=10;
				l2=0;
				b=50;
				
			);
			
			fit=Neural(
				Y( eval(y)),
				X(eval(x)),
				Validation( as column(dt, v[1]) ),
				Informative Missing( 0 ),
				Fit(
					NTanH( t1 ),
					NTanH2( t2 ),
					NLinear( l1 ),
					NLinear2( l2 ),
					Transform Covariates( 1 ),
					Robust Fit( 1 ),
					Number of Tours( 1 ),
					N Boost( B ),
					Learning Rate( 0.5 ),
					Profiler(
						1,
						Confidence Intervals( 1 ),
						Desirability Functions( 1 ),
						Independent Uniform Inputs( 1 ),
					),
					Plot Actual by Predicted( 0 ),
					Plot Residual by Predicted( 0 ),
				)
			);
			
			//set profiler to maximize here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			//set profiler to minimzie here then
			//pf &amp;lt;&amp;lt; Maximize Desirability;
			//pf&amp;lt;&amp;lt;Remember Settings ;
			
			
			//this is what i tried but is not working
			//column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Set Desirabilities;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			
			
			//column(dt, y) &amp;lt;&amp;lt; Set Property( "Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
			pf = report(fit)["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
			pf &amp;lt;&amp;lt; Set Desirabilities;
			pf &amp;lt;&amp;lt; Maximize Desirability;
			pf&amp;lt;&amp;lt;Remember Settings ;
			

		)
	
	)
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this at least gets you going in the right direction!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 15:45:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/361388#M61099</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-02-22T15:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting desirability in a neural net loop</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/362920#M61272</link>
      <description>&lt;P&gt;I reached out to JMP support for help and this is what they came up with which works great:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN class="cs945368b11"&gt;There were a few things going on… the response limits message must point to the column name and must be in a list that itself is a message to the Profiler.&amp;nbsp; Also, it appears you have to reshow the report to get the desirability functions to actually update."&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pf = Report( fit )["Prediction Profiler"] &amp;lt;&amp;lt; get scriptable object;
 
Eval( Eval Expr( pf &amp;lt;&amp;lt; {Expr( Column( dt, y )) &amp;lt;&amp;lt; Response Limits( {Goal( "Minimize" ), Importance( 1 )} )} ) );
Report( fit ) &amp;lt;&amp;lt; reshow();
  
pf &amp;lt;&amp;lt; Maximize Desirability;
pf &amp;lt;&amp;lt; Remember Settings("Min");
                          
Eval( Eval Expr( pf &amp;lt;&amp;lt; {Expr( Column( dt, y )) &amp;lt;&amp;lt; Response Limits( {Goal( "Maximize" ), Importance( 1 )} )} ) );
Report( fit ) &amp;lt;&amp;lt; reshow();
 
pf &amp;lt;&amp;lt; Maximize Desirability;
pf &amp;lt;&amp;lt; Remember Settings("Max");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Feb 2021 23:30:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-desirability-in-a-neural-net-loop/m-p/362920#M61272</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2021-02-25T23:30:22Z</dc:date>
    </item>
  </channel>
</rss>

