BookmarkSubscribeRSS Feed
cgencyurek
Calcite | Level 5

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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 0 replies
  • 632 views
  • 0 likes
  • 1 in conversation