I want to know that all decision tre开发者_Python百科es are binary Trees?
thanks
No, they're not. What if the decision is "What is your favourite colour?" You could have 2 billion answers if you accept 8 bit per channel RGB.
No. All decision trees are not binary trees. But, if you really want a binary tree, you can also do it. In fact, the number of branches depends on the nature of data that you are going to classify.
There are two types of data.
1. Discrete data
2. Continuous data
Suppose A
be the splitting attribute and A
has distinct values {a_1, a_2, ... , a_v}
, based on the training data. Then there are 3 cases.
CASE 1 : A
is discrete valued - a branch is created for each known value of a_j
in A
. For example, if age
is a discrete valued attrribute, it can be branched to young
, medium
or old
.
CASE 2 : A
is continuous valued - the test node has two possible outcomes corresponding to the conditions A <= split_point
and A > split_point
, respectively. For example, if age
is a continuous valued attribute, it can be branched by conditions age <= 55
and age > 55
.
CASE 3 - A
is a discrete valued and a binary tree must be produced - the test at the node if of the form of is A in splitting_subset ?
, where splitting_subset
is the set of values acceptable in a certain decision out of two decisions. For example, if age
is a discrete valued attribute, it can be branched by the form of a test of is age in {young, medium}?
.
精彩评论