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

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