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

How many leaves and nodes should a tree

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

How many leaves and nodes should a tree

 

hello,

 

How many leaves and nodes should a tree have in my model decision tree??

 

What would be the best of leaves

 

thank.

!


Accepted Solutions
Solution
‎12-02-2016 06:31 PM
SAS Employee
Posts: 122

Re: How many leaves and nodes should a tree

Posted in reply to paulkaefer

Hi, 

 

If you are using SAS software like Enterprise Miner or HPSLIT, default settings on these parameters, more often than not, serve you a fairly good baseline deccision tree model. 

 

In the case of Enterprise Miner where you can do what we call interactive tree, you can inject any variable based rules to stop, expand or prune a tree. You can also combine this kind of  'manual' tree with machine built trees. Machine trees are trees most predictive modelers mean when they talk about decision tree modeling. I believe your question is  about machine-built tree (DT). 

 

Best this, best that, the key is one word: validation. Where to stop, how many trees, how many variables to try (in other words, if you have 500K variables, it is not good idea to pump them all in at once to the tree engine), pruning guidance, surrogates... should all be decided on hold-out samples. As for deciding criteria (which I believe is what you are asking, literally), cost-complexity, balance between training and validation, outweighs so-called accuracy. Best practice typically involves rounds of rounds of tweaking. 

 

In the latest and the great SAS Viya ML suite, you have access to a facility called Auto Tuning that allows you to set ranges on (hyper) parameters, like those mentioned in your question, and let Viya tell which are the optimal combination. The search routine goes beyond brute force nature of grid search (Latin Hypercube, anyone). It is directly and immediately scalabe for the modeler to run it against huge data set in-memory. 

 

So what is the best of this and that? Go to work. Decision tree is unlike many other methods and algorithms. In many cases, the best is when you see it, like gardening.  Because there is a visual tree for you to see. 

 

Hope this  helps? 

 

Best Regards

Jason Xin

View solution in original post


All Replies
Regular Contributor
Posts: 175

Re: How many leaves and nodes should a tree

This is a tough question to answer. In reality, there is no best answer. A good place to start is Wikipedia. From the article on decision trees: "An optimal decision tree is then defined as a tree that accounts for most of the data, while minimizing the number of levels (or 'questions')." The section entitled Association rule induction links to two references to learn more about this, and about algorithms to determine the best decision tree for your data.

Solution
‎12-02-2016 06:31 PM
SAS Employee
Posts: 122

Re: How many leaves and nodes should a tree

Posted in reply to paulkaefer

Hi, 

 

If you are using SAS software like Enterprise Miner or HPSLIT, default settings on these parameters, more often than not, serve you a fairly good baseline deccision tree model. 

 

In the case of Enterprise Miner where you can do what we call interactive tree, you can inject any variable based rules to stop, expand or prune a tree. You can also combine this kind of  'manual' tree with machine built trees. Machine trees are trees most predictive modelers mean when they talk about decision tree modeling. I believe your question is  about machine-built tree (DT). 

 

Best this, best that, the key is one word: validation. Where to stop, how many trees, how many variables to try (in other words, if you have 500K variables, it is not good idea to pump them all in at once to the tree engine), pruning guidance, surrogates... should all be decided on hold-out samples. As for deciding criteria (which I believe is what you are asking, literally), cost-complexity, balance between training and validation, outweighs so-called accuracy. Best practice typically involves rounds of rounds of tweaking. 

 

In the latest and the great SAS Viya ML suite, you have access to a facility called Auto Tuning that allows you to set ranges on (hyper) parameters, like those mentioned in your question, and let Viya tell which are the optimal combination. The search routine goes beyond brute force nature of grid search (Latin Hypercube, anyone). It is directly and immediately scalabe for the modeler to run it against huge data set in-memory. 

 

So what is the best of this and that? Go to work. Decision tree is unlike many other methods and algorithms. In many cases, the best is when you see it, like gardening.  Because there is a visual tree for you to see. 

 

Hope this  helps? 

 

Best Regards

Jason Xin

Occasional Contributor
Posts: 11

Re: How many leaves and nodes should a tree

thanks for your help.
But I have seen on the web that they do an interactive configuration, but they do not show the steps to follow.
How could I do it?
I attached the image of what I want to do.

thanks


tree.jpg
SAS Employee
Posts: 122

Re: How many leaves and nodes should a tree

Hi, If you don't see the button to the right to click, open and configure, the chance is the image belongs to a different version of EM. Thanks. Jason Xin
Occasional Contributor
Posts: 11

Re: How many leaves and nodes should a tree

Hello,

the version of tha imagen is the march 2014. It's what I see in the papper. but in my PC the version es sas miner 13.1.

and not see.

But I do not see or know how to configure the parameters.

 

thank

SAS Employee
Posts: 122

Re: How many leaves and nodes should a tree

If possible, could you point me to the paper? Thanks.
Jason Xin
Occasional Contributor
Posts: 11

Re: How many leaves and nodes should a tree

Hello Jason,

 

this is a  paper http://digital.bl.fcen.uba.ar/Download/Tesis/Tesis_5612_Padua.pdf

view page number 56 and 57.

 

I want to modify my tree as shown in the figure on page 57. You can put intervals in the parameters

 

thank !!!

 

Super Contributor
Posts: 337

Re: How many leaves and nodes should a tree

Hey--if you haven't, check out the Getting Started with EM series.

In this one Chip Robie talks about decision trees and you will see a brief screensots of the Interactive Decision trees, starting at 9:15.

Good luck!

-Miguel

 

https://youtu.be/IlUZYlgkeSc?t=9m15s

http://support.sas.com/software/products/miner/index.html Chip Robie of SAS presents the third in a series of six "Getting Started with SAS Enterprise Miner 13.2" videos. This third video demonstrates building decision trees in SAS Enterprise Miner. For more information regarding SAS Enterprise ...
Occasional Contributor
Posts: 11

Re: How many leaves and nodes should a tree

Posted in reply to M_Maldonado
Thank Miguel!!
☑ This topic is solved.

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

Discussion stats
  • 9 replies
  • 998 views
  • 2 likes
  • 4 in conversation