460-hw1sol

# 460-hw1sol - CS4600 Introduction to Intelligent Systems...

This preview shows pages 1–3. Sign up to view the full content.

CS4600 - Introduction to Intelligent Systems Homework 1 - Decision Trees - Sample Solution Assume that you have the following training examples available: Use all of the training examples to construct a decision tree. In case of ties between features, break ties in favor of features with smaller numbers (for example, favor F1 over F2, F2 over F3, and so on). How does the resulting decision tree classify the following example: F1 F2 F3 F4 F5 Class Example 1 t t f f f p Example 2 f f t t f p Example 3 t f f t f p Example 4 t f t f t p Example 5 f t f f f n Example 6 t t f t t n Example 7 f tttt n F1 F2 F3 F4 F5 Class Example 8 f f f t t ?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Some formula: Pre-compute some I(x,y) I(0,x) = I(x,0) = -1 log 2 1 - 0 log 2 0 = 0 I(x,x) = - 1/2 log 2 1/2 - 1/2 log 2 1/2 = 1 I(1,2) = I(2,1) = - 2/3 log 2 2/3 - 1/3 log 2 1/3 = 0.918 I(1,3) = I(3,1) = - 3/4 log 2 3/4 - 1/4 log 2 1/4 = 0.811 I(3,4) = I(4,3) = - 4/7 log 2 4/7 - 3/7 log 2 3/7 = 0.985 First, choose from {F1, F2, F3, F4, F5} to become the root. E(F1) = 4/7 * I(3,1) + 3/7 * I(1,2) = 4/7 * 0.811 + 3/7 * 0.918 = 0.857 E(F2) = 4/7 * I(1,3) + 3/7 * I(3,0) = 4/7 * 0.811 + 3/7 * 0 = 0.463 E(F3) = 3/7 * I(2,1) + 4/7 * I(2,2) = 3/7 * 0.918 + 4/7 * 1 = 0.965
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

460-hw1sol - CS4600 Introduction to Intelligent Systems...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online