I ran gradient boosting in EM and want to use the attached scoring code to the new dataset. How can I use it for scoring, as its written without setting a dataset and even some variables used are not present.
Just like with all data step score code from EM:
data /* name of data set containing scores */;
set /* data that you want to score */;
%inc "/app/sasdata/EBI_ADVANL/EM_Projects/churn/Workspaces/EMWS1/Boost/EMPUBLISHSCORE.sas " /* or paste in the score code */;
run;
You can't easily. How are you getting data in without a SET statement?
Just like with all data step score code from EM:
data /* name of data set containing scores */;
set /* data that you want to score */;
%inc "/app/sasdata/EBI_ADVANL/EM_Projects/churn/Workspaces/EMWS1/Boost/EMPUBLISHSCORE.sas " /* or paste in the score code */;
run;
But my dataset, does not have some variables, which are there in code. I am not sure, how this code is generated.
If you built a model that requires certain variables and you want to score with the same model you need those variables. If you don't have those variables, then either remove them and rebuild your model, OR change your model so it can handle missing values by including missing values for that variable in the training data.
Did you build your model?
In the process did you create any new variables? SAS may have automatically named them. SAS may also be creating automatic variables required in your model, for intermediate steps.
Your input dataset needs to match the structure of your training data set. Same variables, same names, same types and same levels for categorical data.
My suggestion would be to try and see what happens.
@WendyCzika has shown the correct way to score a new dataset.
I'm guessing the _ variables that you mean, if they are not input variables, are created BY the scoring code - they don't need to be in the data you are scoring, so it should be fine.
It's defined above that:
_ARB_BADF_ = 0;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.