Hello experts,
I developed an ensemble model that includes 4 gradient boosting and 1 logistic regression algorithm. We will schedule the scoring process for new customers by using the code we will develop on Viya SAS Studio.
I could score new data with only a gradient boosting model by the code below:
--------------------------------------------------------------------------------------------------------------------------------------------
%let input_dsn=DUALSIMVAR_FOR_SCORING_2;
%let input_extension=sashdat;
%let inlib=public;
%let outlib=public;
* Assign CAS libraries;
cas;
caslib _all_ assign;
* Load Scoring Data into Memory ;
proc casutil;
load casdata="&input_dsn..&input_extension." inCASlib="&inlib."
casOut="&input_dsn." outCASlib=&outlib. replace;
quit;
* Load the astore model in memory, the name of the model will be in the epscore code and needs to be all UPPERCASE;
/* GB Model Score Code Data */
proc casutil;
load casdata="_CI90I2WLVU1A7P74YRPLYI7AK_ast.sashdat" inCASlib="models"
casOut="DualSimGBmodel" outCASlib=casuser replace;
quit;
* Score the new dataset using the EP score code that calls the astore model;
proc astore;
score data=&outlib..&input_dsn. out=casuser.scr_GB_&input_dsn.
rstore=casuser.DualSimGBmodel
/* epcode="/Public/Score_Codes/GBModel_EPCode.sas"; */
;
quit;
--------------------------------------------------------------------------------------------------------------------------------------------
As you can see, I did not use epcode for this scoring by using one gradient boosting algorithm (commented out).
However, when I dowload score code (EP code) of the ensemble node, there are 4 _AST.sashdat files. I tried to use the same logic like below:
--------------------------------------------------------------------------------------------------------------------------------------------
/* GeoMean Model Score Code Data */
proc casutil;
load casdata="_7IY8HOERYZLAQG8QPRZ58WA53_ast.sashdat"
casdata="_3JFVN5DFZ7HRPCURB691LTM0D_ast.sashdat"
casdata="_OP7FTXK9YOGMLWB3LQWK53NP_ast.sashdat"
inCASlib="models"
casOut="DualSimGeoModel_1" outCASlib=casuser replace;
quit;
*create the EP score code to run the ASTORE model on the CAS Server;
/* */
proc astore;
describe rstore=casuser.DualSimGeoModel
epcode="/Public/Score_Codes/EnsembleGeoModel_EPCode.sas" ;
score data=PUBLIC.DualSimScoringData out=casuser.GeoMean_Dual;
quit;
--------------------------------------------------------------------------------------------------------------------------------------------
However we found that first part of the code load only the last casdata statement, it crushes previous ones. So, my question is: "Should I load all astore tables seperately one by one, in this case?" If so, "How can I use those multiple astore tables through EP code?". In online documents I found that it is need to use epcode for multiple ASTORE tables, but there was not any examples of multiple astore codes. I share the EP Code of ensemble node.
Also, when I try to use EPcode statement I get the error of read/write access? If I can get a read/write access authorization would it be enough?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.