BookmarkSubscribeRSS Feed
stellarr
Calcite | Level 5

I have a trained model with hpforest proceduce and saved it as a binary file.
Is it possible to extract the rules of the model ?

2 REPLIES 2
ballardw
Super User

It might help someone that knows more about this topic to show the code that created your model and how you saved the model.

 

Sometimes different options limit what may be stored. So if you have used such that person that understands the topic better than I may suggest changes to the code to rebuild the model in a way that will allow you to do what you request.

stellarr
Calcite | Level 5

Thanks for the suggesting, below is the code. I'm using SASPY which uses thePROC HPFOREST 

The saved model is the rf.bin binary file. The goal is to extract the rules from the rf.bin.Just like in decision tree we can WHOLETREEPLOT for  HPSPLIT .

hpforest_model = ml.hpforest(data=hmeq, 
                             input=var_inputs, 
                             target="BAD /level = binary",
                             score = "out = work.forest_score",
                             save = "rf.bin",
                             id = "_PartInd_",
                             partition="rolevar=_partind_(TRAIN='1' VALIDATE='0');")

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 620 views
  • 0 likes
  • 2 in conversation