该帮助的版本不再更新,请参见https://www.jmp.com/support/help/zh-cn/15.2 获取最新的版本.


dt = Open( "$SAMPLE_DATA/Liver Cancer.jmp" );
fd = Formula Depot(); // open a new Formula Depot
obj1 = dt << Run Script( "Lasso Poisson, Validation Column" );
model = obj1 << (Fit[1] << Publish Prediction Formula);
case_name = "fitLS_prediction";
dest_dir = "c:\"; //CHANGE ME to a better location
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Print( "Running " || case_name );
fm_ls = Fit Model(
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
fd = fm_ls << Publish Prediction Formula;
Print( "Generate Python Code" );
code = fd << Generate Python Code( No Editor );
Save Text File( dest_dir || case_name || ".py", code );
Print( "Done." );
Print( "Code generation failed for " || case_name || ", reason: " );
Show( exception_msg );
fdw = Window( "Report: Formula Depot" );
fdw << Close Window( No Save );
Close( dt, No Save );