BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sq
Calcite | Level 5 sq
Calcite | Level 5

Hey!

 

I've created a HP Forest model in SAS Enterprise Miner 14.3 and I want to use the same model to score new data set on a daily basis. The plan is to run the model in Base SAS, so I am trying to check if the code is working properly in Enterprise Guide or Base SAS. I did the testing in the DATA step in SAS EG:

 

data D702348.TEST_TEST_TEST;
    set D702348.ML_ASK_SCORE_2;

run;SASEM.PNG

 

 

I copied SAS Code from Score node (from Enterprise Miner) and ran it in SAS Enterprise Guide, I get several warnings and error messages:

SASEM_warns.PNG

 

 

I suppose I have to define some of the macro variables in order for my code to work, but I struggle to understand what are those variables and which of them I should define manually. This is the part of the SAS Code I struggle with:

 

%macro em_hpfst_score;

%if %symexist(hpfst_score_input)=0 %then %let hpfst_score_input=&em_score_output;
%if %symexist(hpfst_score_output)=0 %then %let hpfst_score_output=&em_score_output;
%if %symexist(hpfst_id_vars)=0 %then %let hpfst_id_vars = _ALL_;

%let hpvvn= %sysfunc(getoption(VALIDVARNAME));
options validvarname=V7;
proc hp4score data=&hpfst_score_input;
id &hpfst_id_vars;
%if %symexist(EM_USER_OUTMDLFILE)=0 %then %do;
score file="C:\EMiner\ML\Workspaces\EMWS6\HPDMForest\OUTMDLFILE.bin" out=&hpfst_score_output;
%end;
%else %do;
score file="&EM_USER_OUTMDLFILE" out=&hpfst_score_output;
%end;
PERFORMANCE DETAILS;
run;

options validvarname=&hpvvn;

data &hpfst_score_output;
set &hpfst_score_output;
%mend;

 

I tried to set hpfst_score_input and hpfst_score_output as D702348.ML_ASK_SCORE_2 and D702348.TEST_TEST_TEST respectively, but it didnt help much. I would really love to understand the meaning of those macro variables instead of just trying something until it possibly works.

 

Can anyone please help me to understand what I could have missed/misunderstood? 

 

Best regards,

sq

1 ACCEPTED SOLUTION

Accepted Solutions
MikeStockstill
SAS Employee

Hello SQ-

 

The score code that is created by the HP Forest node includes a PROC HP4SCORE invocation - the code cannot be executed unless Enterprise Miner is installed on the machine that does the scoring.  (I.e., you cannot use just Base SAS to execute the score code.)

 

There are some details within Enterprise Miner under Help -> Contents -> Node Reference -> HPDM Nodes -> HP Forest Node -> HP Forest Node Requirements.  The Example section of that chapter shows how you can use code for scoring - see Step 6 and beyond.

 

Thank you for your interest!

View solution in original post

1 REPLY 1
MikeStockstill
SAS Employee

Hello SQ-

 

The score code that is created by the HP Forest node includes a PROC HP4SCORE invocation - the code cannot be executed unless Enterprise Miner is installed on the machine that does the scoring.  (I.e., you cannot use just Base SAS to execute the score code.)

 

There are some details within Enterprise Miner under Help -> Contents -> Node Reference -> HPDM Nodes -> HP Forest Node -> HP Forest Node Requirements.  The Example section of that chapter shows how you can use code for scoring - see Step 6 and beyond.

 

Thank you for your interest!

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 915 views
  • 2 likes
  • 2 in conversation