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;
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
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
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
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 16. Read more here about why you should contribute and what is in it for you!
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.