Decision Tree
Decision Tree
Decision Tree
https://www.saedsayad.com/decision_tree.htm
1
1
Classification and Prediction
Classification is the process of finding a model (or function)
that describes and distinguishes data classes or concepts.
The model are derived based on the analysis of a set of
training data (i.e., data objects for which the class labels are
known).
The model is used to predict the class label of objects for
which the class label is unknown.
2
Decision Tree Induction
A decision tree is a flowchart-like tree structure, where each
node denotes a test on an attribute value, each branch
represents an outcome of the test, and tree leaves represent
classes or class distributions.
At each node, the algorithm chooses the “best” attribute to
partition the data into individual classes.
The construction of decision tree classifiers does not require
any domain knowledge or parameter setting, and therefore is
appropriate for exploratory knowledge discovery.
Decision trees can easily be converted to classification rules.
Decision trees can handle multidimensional data.
4
Decision Tree Induction: Training Dataset
age income student credit_rating buys_computer
<=30 high no fair no
<=30 high no excellent no
31…40 high no fair yes
This >40 medium no fair yes
follows an >40 low yes fair yes
example of >40 low yes excellent no
31…40 low yes excellent yes
Quinlan’s <=30 medium no fair no
ID3 <=30 low yes fair yes
>40 medium yes fair yes
(Playing <=30 medium yes excellent yes
Tennis) 31…40 medium no excellent yes
31…40 high yes fair yes
>40 medium no excellent no
5
Output: A Decision Tree for “buys_computer”
age?
<=30 overcast
31..40 >40
no yes yes
6
Algorithm for Decision Tree Induction
Basic algorithm (a greedy algorithm)
– Tree is constructed in a top-down recursive divide-and-conquer
manner
– At start, all the training examples are at the root
– Attributes are categorical (if continuous-valued, they are discretized
in advance)
– Examples are partitioned recursively based on selected attributes
– Test attributes are selected on the basis of a heuristic or statistical
measure (e.g., information gain)
7
Attribute Selection Measure for ID3: Information Gain
j1 | D|
Information gained by branching on attribute A
Gain(A) Info(D) InfoA(D)
9
Attribute Selection: Information Gain
12
Thank you for your attention.
Any Question?
13