The following code works and derives a score as expected, even the download and upload execute without errors and show the expected results.
BUT when I close the session and come back, I cannot re-activate the scoring code.
How Do I make it survive the session?
cas mySession sessopts=(caslib='casuser');
PROC CAS;
regression.glm
table={name='rema', caslib='casuser', groupby={'_brand'}, where=" _o_sales_res ne .",
computedvars='months_since_covid',
computedvarsprogram="months_since_covid= intck('month', '15mar2020'd, today())"},
class={{name={'/msi_model\b|_gama_agg\b/'}}
},
model={ depVar='RMNVALORVENTA',
effects={{ vars='/_gama_agg|MESES_EFECTIVOS|_o_actual_mileage/'
interact='bar' ,maxinteract=1 }
, {vars={ 'poly'}}
}},
selection={method='forward'}, spline={{basis="BSPLINE",
dataBoundary=false, degree=2, vars={'months_since_covid'}, name="spl"}
},
polynomial={{
degree=2,
mdegree=2,
details=TRUE,
labelStyle={
expand=TRUE
exponent="^"
includeName=TRUE
productSymbol="NONE"
},
name='poly',
vars={"MESES_EFECTIVOS"}
}},
output={casOut={name='out1', replace=true},
copyVars="ALL_MODEL",
pred='pred', resid='resid', role='role'}, outputtables={includeall=true, replace=true}
store={name='myModel', replace=true};
run;
proc cas;
regression.glmScore
restore='myModel',
/* restore={caslib='casuser', name='VR_ABS_SIMPLE'}, */
table={name='rema', caslib='casuser', groupby={'_brand'}, where="1=1"},
fitData='false',
casOut={name='out2', replace=true, caslib='mkt'},
/* copyVars="ALL", */
pred='pred', resid='resid', rstudent='rstudent';
run;
proc astore;
describe rstore=casuser.MYMODEL ;
quit;
proc astore;
download rstore=casuser.MYMODEL
store='VR_ABS_SIMPLE';
quit;
proc astore;
upload rstore=casuser.model_restored
store='VR_ABS_SIMPLE';
describe rstore=casuser.model_restored;
quit;
... View more