Hi @shampton82 ,
Nice bit of code, and I like the idea of what you're intending to do with it.
After trying out the code with the Diabetes data table, here's some feedback to help get you in the right direction, hopefully.
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.
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.
The below code works, but you have to manually edit the window. I'd like to know how to do it through JSL, though.
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 ),
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 << Set Desirabilities;
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 << Set Desirabilities;
pf << Maximize Desirability;
pf<<Remember Settings ;
)
)
);
Hope this at least gets you going in the right direction!,
DS