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

Hi.   Is there a way in SAS to generate predicted values after running a random forest model?  I've looked at the HPFOREST documentation and I don't see a way of doing this.   I've done something similar with CART with Proc HPSPLIT, but I couldn't find a similar way to do it for Random Forests.  Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
WendyCzika
SAS Employee

You should be able to use the SCORE statement to create a data set with the predicted values for the training data: https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hpforest_syntax08.htm

Or you can use the SAVE statement to create an analytic store ("astore") file that allows you to score new data using that generated file in HP4SCORE: https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hpforest_syntax07.htm

and https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hp4score_toc.htm  

 

Hope that helps.

View solution in original post

1 REPLY 1
WendyCzika
SAS Employee

You should be able to use the SCORE statement to create a data set with the predicted values for the training data: https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hpforest_syntax08.htm

Or you can use the SAVE statement to create an analytic store ("astore") file that allows you to score new data using that generated file in HP4SCORE: https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hpforest_syntax07.htm

and https://go.documentation.sas.com/doc/en/emhpprcref/15.2/emhpprcref_hp4score_toc.htm  

 

Hope that helps.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to choose a machine learning algorithm

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.

Discussion stats
  • 1 reply
  • 5868 views
  • 0 likes
  • 2 in conversation