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

Howdy

I would like to use a model from PROC HPForest in EG to score a dataset.  It looks like HP4SCORE is designed to take a model output from HPForest but I cannot see how to output the model in any documentation, which is pretty sparse on this PROC.  ods trace on /listing does not indicate any useful objects are being output for this purpose.

Any ideas?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
M_Maldonado
Barite | Level 11

Tronfela,

Howdy!

If you created your HPForest model using Enterpise Miner, the easiest to score in EG would be to borrow the scorecode sas program as described in the tip below.

Step number 4 tells you where to grab it. It includes a HP4Score that you can use as an example.

I know it is a bit confusing that you have to use another proc to score, but it keeps thing very efficient. Data step code to score an hpforest model would be quite large.

I hope this helps!

Miguel

View solution in original post

2 REPLIES 2
M_Maldonado
Barite | Level 11

Tronfela,

Howdy!

If you created your HPForest model using Enterpise Miner, the easiest to score in EG would be to borrow the scorecode sas program as described in the tip below.

Step number 4 tells you where to grab it. It includes a HP4Score that you can use as an example.

I know it is a bit confusing that you have to use another proc to score, but it keeps thing very efficient. Data step code to score an hpforest model would be quite large.

I hope this helps!

Miguel

tronfela
Calcite | Level 5

Thanks.  That is pretty close to what I ended up using.  I intended to create a macro in EG, so hp4score seemed like the correct proc.  The "save file=" syntax (below in bold) was what I could not find in any documentation.  It seems to have to appear after ods output and EG editor shows "save" as an error in red.

proc hpforest data=work.rftrain ;

target y /level=interval;

input x1--x42 /level=interval;

ods output fitstatistics=fitstats;

save file="P:\model.bin";

run;

proc hp4score data=rftest;

id Index y;

score file="P\model.bin" out=rfscored;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 6171 views
  • 1 like
  • 2 in conversation