Docsity

Decision Tree - Artificial Intelligence - Lecture 8 | CECS 451, Study notes of Computer Science

Toggle sidebar
bg1
Lecture 8: Decision Trees
Decision Trees:
•used for classifying data into discrete categories
•an internal node of the tree represents a question about the feature vector whose answer
dictates which child node is next considered (i.e. which question is next asked)
•each leaf node represents a potential classification of the feature vector
•alternatively (from a logical perspective), decision trees allow categories to be repre-
sented as logical disjunctions of conjunctions of attributes
1
pf3
pf4
pf5
pf8

Partial preview of the text

Download Decision Tree - Artificial Intelligence - Lecture 8 | CECS 451 and more Study notes Computer Science in PDF only on Docsity!

Lecture 8: Decision Trees

Decision Trees:

  • used for classifying data into discrete categories
  • an internal node of the tree represents a question about the feature vector whose answer dictates which child node is next considered (i.e. which question is next asked)
  • each leaf node represents a potential classification of the feature vector
  • alternatively (from a logical perspective), decision trees allow categories to be repre- sented as logical disjunctions of conjunctions of attributes

Characteristics of problems suitable for decision-tree learning

  • instances are represented by feature vectors whose feature components are preferably discrete
  • instances are discretely classified
  • a disjunctive description represents a reasonable means of classification
  • errors may exist, such as missing attribute values or erroneous classification of some training vectors

Entropy as a Measure of Information Content

Entropy of a random variable: Let X be a random variable that takes on values from the set {x 1 , x 2 ,... , xn} with respective probabilities p 1 , p 2 ,... , pn, where sumipi = 1. Then the entropy of X, H(X), represents the average amount of information contained in X and is defined by

H(X) = −

∑^ n

i=

pi log 2 pi.

Justification for the definition of H(X):

Entropy Example 1: calculate the amount of information contained in a weather forecast if the possibilities include {normal, rain, f og, hot, windy} if there respective probabilities are. 9 ,. 05 ,. 01 , .02, and .02.

Entropy Example 2: recall the 12-balls puzzle. Which of the six possible initial balancing configurations provides the most information to the user?

Entropy of a collection of classified feature vectors: given a set of traning feature vectors S, suppose that the vectors are classified in c different ways, and that pi represents the proportion of vectors in S that belong to the i th class. Then the classification entropy of S is defined as

Entropy(S) = −

∑^ c

i=

pi log 2 pi.

Entropy Example 3: calculate the classification entropy for the following set of feature vectors.

Weight color texture classification medium orange smooth orange heavy green smooth melon medium green smooth apple light red bumpy berry medium orange bumpy orange light red bumpy berry heavy green rough melon medium red smooth apple heavy yellow smooth melon medium yellow smooth orange medium red smooth apple medium green smooth apple medium orange rough orange

Inductive Bias in Decision Tree Learning

  • The hypothesis space of decision trees is complete in the sense that for every set S of feature vectors there exists a decision tree TS which correctly classifies all of the training vectors.
  • Bias is given towards those trees which are shorter and for which place towards the root attributes with high information gain
  • Preference bias: a bias towards hypotheses based upon properties they may possess.
  • Restriction bias: a bias towards hypotheses which restricts them to have a particular type of form.

Occam’s Razor: when choosing amoung competing theories to explain a set of data, choose the most simplest one that is consistent with the data.

Longer hypothesis also run the risk of overfitting the data. Hypothesis h ∈ H is said to overfit the data if there exists an alternative hypothesis h

′ ∈ H for which h has smaller error than h ′ over the training data, but h ′ outperforms h over the entire distribution of test cases.

Rule post-pruning steps:

  1. develop the decision tree without any concern towards overfitting
  2. convert tree into an equivalent set of rules
  3. prune each rule by removing any preconditions whose removal improves accuracy
  4. sort rules by their estimated accuracy and use them in this sequence

Split Information: let A be an attribute, considered here as a discrete set of possible values. Then the split information relative to A and a set of feature vectors S is defined as

SI(A, S) = −

∑

a∈A

|Sa| |S|

log

|Sa| |S|

where Sa represents the set of feature vectors v ∈ S such that vA = a.

For attributes that take on many values, using the ratio IG SI((S,AS,A)) instead of IG(S, A) can help avoid favoring many-valued attributes which do not perform well in classifying the data.