Hello everyone,
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. I haven't been able to get this work work though. Here is the script I am working with and I've been testing on the diabetes sample data set:
names default to here(1);
dt=current datatable();
selCols = dt << Get column names( String );
obj2=new window("Reponse Variable",
<<Modal,
<<Return Result,
LineupBox( NCol( 1 ), Spacing( 5 ),
v list box(textbox("select response"),choseny = ColListBox( dt, all, <<Set Data Type( "Numeric" ) ,grouped ),
v list box(textbox("select validation"),chosenv = ColListBox( dt, all, <<Set Data Type( "Numeric" ) ,grouped ))
)
),
v list box(textbox("select predictors"),chosenx = ColListBox(dt,<<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 <= 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 << Maximize Desirability;
//pf<<Remember Settings ;
//set profiler to minimzie here then
//pf << Maximize Desirability;
//pf<<Remember Settings ;
//this is what i tried but is not working
column(dt, y) << Set Property( "Response Limits", {Goal( Minimize ), Importance( 1 ), Show Limits( 0 )});
pf = report(fit)["Prediction Profiler"] << get scriptable object;
pf << Maximize Desirability;
pf<<Remember Settings ;
column(dt, y) << Set Property( "Response Limits", {Goal( Maximize ), Importance( 1 ), Show Limits( 0 )});
pf = report(fit)["Prediction Profiler"] << get scriptable object;
pf << Maximize Desirability;
pf<<Remember Settings ;
)
)
);The script will produce two separate saved settings but it is at the same state.
Thanks for any ideas!
Steve