Hi @cwillden,
Thanks for your input on this, it's a great solution! It works with my test script that shows a progress indicator for the overall modelling progress when I run a large tuning table.
My end goal is to put the call to fit the data into the loop_expr portion so that I can pause the overall modeling process and resume it later. I think this might take a little more finagling. I am testing it with script (Mark Bailey's) from this post here using the SVM platform.
Here's the progress bar/iteration script I have that I'd like to use to "control" the progress by being able to pause and then resume at a later time.
Names Default To Here( 1 );
i = 1;
imax = 100;
dlgStatus = New Window( "Overall Modeling Progress",
V List Box(
Text Box( " Overall Modeling Progress ", <<Set Font Size( 12 ), <<Justify Text( "center" ), <<Set width( 200 ) ),
dlg_gb = Graph Box( FrameSize( 200, 15 ), X Scale( 0, 100 ), Y Scale( 0, 1 ) ),
tb = Text Box(
"Current step " || Char( i ) || " of " || Char( imax ),
<<Set Font Size( 12 ),
<<Justify Text( "center" ),
<<Set width( 200 )
),
H List Box( bbp = Button Box( "Pause", On Pause ), bbr = Button Box( "Resume", On Resume ) )
)
);
dlg_gb[Axis Box( 2 )] << Delete;
dlg_gb[Axis Box( 1 )] << Delete;
pause_state = 0;
iter = 0;
Loop_Expr();
Loop_expr = Expr(
For( i = iter + 1, i <= imax, i++,
iter = i;
prog = (i / imax) * 100;
dlgStatus[FrameBox( 1 )] << Add Graphics Script( {Fill Color( "purple" ), Rect( 0, 1, prog, 0, 1 )} );
tb << set text( "Current step " || Char( i ) || " of " || Char( imax ) );
Wait( 0.1 );
If( pause_state == 1,
Break()
);
)
);
On Resume = Expr(
pause_state = 0;
bbr << Enable( 0 );
Loop_expr();
);
On Pause = Expr(
pause_state = 1;
bbr << Enable( 1 );
);
Here's the SVM script that Mark wrote:
Names Default To Here( 1 );
// use a small example
data = Open( "$SAMPLE_DATA/Big Class.jmp" );
// launch SVM platform
svm = data << Support Vector Machines( Y( :age ), X( :height, :weight ) );
// iterate over a range of hyper-parameters
For( cost = 0.1, cost <= 5, cost += 0.05,
For( gamma = 0.1, gamma <= 1, gamma += 0.1,
svm << Fit(
Kernel Function( "Radial Basis Function" ),
Gamma( gamma ),
Cost( cost ),
Validation Method( "None" )
)
)
);
// separate parameters and performance in a new table
results = Report( svm )["Model Comparison"][Table Box( 1 )] << Make Into Data Table;
// fit interpolator for profiling
results << Neural(
Y( :Training Misclassification Rate ),
X( :Cost, :Gamma ),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit(
NTanH( 3 ),
Profiler(
1,
Confidence Intervals( 1 ),
Term Value( Cost( 2.75, Lock( 0 ), Show( 1 ) ), Gamma( 1, Lock( 0 ), Show( 1 ) ) )
),
Plot Actual by Predicted( 1 ),
Plot Residual by Predicted( 1 )
)
);
Any suggestions on how to do that would be great!
Thanks!,
DS