dt = Open( "$SAMPLE_DATA/Liver Cancer.jmp" );
fd = Formula Depot();
obj1 = dt << Run Script( "Lasso Poisson分布 検証列" );
model = obj1 << (Fit[1] << Publish Prediction Formula);
case_name = "fitLS_prediction";
dest_dir = "c:\";
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Print( "Running " || case_name );
fm_ls = Fit Model(
Y( :weight ),
Effects( :年齢, :性別, :Name("身長(インチ)") ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run
);
fd = fm_ls << Publish Prediction Formula;
Try(
Print( "Pythonコードを生成" );
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( "Liver Cancer - 計算式デポ" );
fdw << Close Window( No Save );
Close( dt, No Save );