BookmarkSubscribeRSS Feed
SASEMUser
Calcite | Level 5

Hello, I am using SAS EM 12.1. Have a question with regards to the "Code Node" and "Score Node". I was trying to build a simple model using the SAS "Code Node", then I want to use the "Score node" to apply the model (built in the "Code Node") to predict (score) another data set. I cannot to get this work. Anybody has experience or point me to the right place?

I have used the "Score Node" and other SAS EM Nodes (such as "Decision Tree") to do the scoring and it works.


Thanks

1 REPLY 1
PatrickHall
Obsidian | Level 7

Generally user code from the code node cannot be included in the score node - for many reasons - but there are a lot of other options:

- You can include simple rules for scoring in the score pane of the code node.

- You can use the PROC that creates your model to score the &EM_IMPORT_SCORE data set and use the results to create the &EM_EXPORT_SCORE data set.

- If your model creates data step score code you can turn that code into the node's score code using code like the following:

*** COPY DS_FILE INTO NODE DIRECTORY AS SCORE CODE;

filename cpy_in "&DS_SCORE_CODE_FILE";                                                                                                                                                                                                                       

filename cpy_out "&EM_FILE_EMFLOWSCORECODE";                                                                                                                                                                                                              

%EM_COPYFILE(infref=cpy_in, outfref=cpy_out);                                                                                                                                                                                                            

filename cpy_out;

                                                                                                                                                                                                                     

filename cpy_out "&EM_FILE_EMPUBLISHSCORECODE";                                                                                                                                                                                                              

%EM_COPYFILE(infref=cpy_in, outfref=cpy_out);                                                                                                                                                                                                            

filename cpy_in;

filename cpy_out;

*** %EM_MODEL ACTUALLY GENERATES COLUMNS AND ASSESSMENT INFO;

%EM_MODEL(

  TARGET=%EM_TARGET,

  ASSESS=Y,

  CLASSIFICATION=Y,

  DECSCORECODE=N,

  FITSTATISTICS=Y,

  RESIDUALS=Y

);

- You can ask your technical support representative for more documentation regarding the %EM_MODEL and %EM_ASSES macros.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 560 views
  • 0 likes
  • 2 in conversation