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

hi. i am using proc arboretum for decision tree algorithm in sas 9.4 version .my target variable is nominal (categorical) with 24 level .when i applied proc arboretum it gave me a tree .does proc arboretum prunes the tree by default ? if not how can i prune it? how do i  select a branch to be pruned? how to check the accuracy ?if anyone knows appreciate share it with me. is there any book for sas 9.4 version that explains it? thanks for any help.

 

proc arboretum data=mydata ;
    target x1 / level=nominal;
    input  x2 x3 x4 x5  /level=nominal;
    input  x6 x7 x8 x9 x10x x11 x12  x13  x14  x15  x16  x17  x18  x19  x20 / level=interval;
 
    save   IMPORTANCE=imp  MODEL=model    NODESTATS=nodstat
    RULES=rul   SEQUENCE=seq    STATSBYNODE= statb   summary=sum   ;
run;
quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PadraicGNeville
SAS Employee

Hi, Fatemeh.

 

Yes, by default, PROC ARBORETUM does retrospective pruning.  The SEQUENCE=seq data set contains a subtree sequence with some fit statistic for each subtree.  You can select a specific subtree, say one with 10 leaves,  by

PROC ARBOR INMODEL=model;

SUBTREE NLEAVES=10;

SAVE MODEL=newmodel;

QUIT;

 

To prune a specific node, say node 20, do,

PROC ARBOR INMODEL=model;

PRUNE nodes=20;

SAVE MODEL=newmodel;

QUIT;

 

  I googled "SAS PROC ARBORETUM" and the documentation came up first.

Let me know if you need more information about ARBOR.

-Padraic

 

View solution in original post

2 REPLIES 2
DougWielenga
SAS Employee

The ARBORETUM procedure was designed to be used by the Decision Tree node in SAS Enterprise Miner so using it directly is not supported.  If you have SAS Enterprise Miner, it is easy to prune trees using the Interactive property in the Decision Tree node. 

 

If you want to call a procedure to fit a tree, try using the HPSPLIT procedure which was initially available in SAS/STAT 14.1.   The HPSPLIT procedure has a PRUNE statement that should provide what you need.   You can find the documentation for this procedure by viewing the SAS/STAT 14.x documentation at 

 

    https://support.sas.com/documentation/onlinedoc/stat/index.html

 

and then opening the link to the SAS/STAT 14.x User's Guide SAS/STAT Procedures

 

Hope this helps!

Doug

PadraicGNeville
SAS Employee

Hi, Fatemeh.

 

Yes, by default, PROC ARBORETUM does retrospective pruning.  The SEQUENCE=seq data set contains a subtree sequence with some fit statistic for each subtree.  You can select a specific subtree, say one with 10 leaves,  by

PROC ARBOR INMODEL=model;

SUBTREE NLEAVES=10;

SAVE MODEL=newmodel;

QUIT;

 

To prune a specific node, say node 20, do,

PROC ARBOR INMODEL=model;

PRUNE nodes=20;

SAVE MODEL=newmodel;

QUIT;

 

  I googled "SAS PROC ARBORETUM" and the documentation came up first.

Let me know if you need more information about ARBOR.

-Padraic

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4915 views
  • 0 likes
  • 3 in conversation