Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

PROC HPSPLIT Decision Tree

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

PROC HPSPLIT Decision Tree

Hello Everyone,

 

After using the PROC HPSPLIT, a decision tree with at depth of 10 is returned. However, SAS only shows the first three splits from Node=0 and the whole tree cannot be viewed. How do I view the entire decision tree? Also, I would like to see the number of observations at each node. How do would I see that?

 

Thanks a lot!

 

Jack


Accepted Solutions
Solution
a week ago
SAS Employee
Posts: 109

Re: PROC HPSPLIT Decision Tree

On the PROC HPSPLIT statement, there is a PLOTS option that will allow you to open up the subtree where you start and to a set depth.  In complex trees, you will not be able to reasonably see the entire tree in one plot without losing many details.  The code below refers to the SAMPSIO.HMEQ data set which is available as a sample data set in SAS Enterprise Miner and is also attached here. The code requests the displayed Tree to have a depth of 5 beginning from node "3":

 

/*** BEGIN SAS CODE ***/

 

 

libname x 'c:\data';   * < note: change libname and path as needed > ;

 

proc hpsplit data=x.hmeq seed=123 maxdepth=10 plots=(zoomedtree(nodes=("3") depth=5));

   class bad reason job;

   model bad (event='1') = debtinc derog loan mortdue value job reason clno ninq yoj;

   grow entropy;

   prune off;* costcomplexity(leaves=all);

run;

 

/*** END SAS CODE ***/

 

I hope this helps!

Doug

 

View solution in original post


All Replies
Solution
a week ago
SAS Employee
Posts: 109

Re: PROC HPSPLIT Decision Tree

On the PROC HPSPLIT statement, there is a PLOTS option that will allow you to open up the subtree where you start and to a set depth.  In complex trees, you will not be able to reasonably see the entire tree in one plot without losing many details.  The code below refers to the SAMPSIO.HMEQ data set which is available as a sample data set in SAS Enterprise Miner and is also attached here. The code requests the displayed Tree to have a depth of 5 beginning from node "3":

 

/*** BEGIN SAS CODE ***/

 

 

libname x 'c:\data';   * < note: change libname and path as needed > ;

 

proc hpsplit data=x.hmeq seed=123 maxdepth=10 plots=(zoomedtree(nodes=("3") depth=5));

   class bad reason job;

   model bad (event='1') = debtinc derog loan mortdue value job reason clno ninq yoj;

   grow entropy;

   prune off;* costcomplexity(leaves=all);

run;

 

/*** END SAS CODE ***/

 

I hope this helps!

Doug

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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