P02 DecisionTrees
P02 DecisionTrees
Practical exercises
Plot the learned decision tree using information gain (Shannon entropy). Show your calculus.
2. Show if a decision tree can learn the following logical functions and, if so, plot the corresponding
decision boundaries.
a) AND
b) OR
c) XOR
3. Consider the following testing targets, 𝒛, and the corresponding predictions, 𝒛̂, by a decision tree:
𝒛 = [𝐴 𝐴 𝐴 𝐵 𝐵 𝐵 𝐶 𝐶 𝐶 𝐶]
𝒛̂ = [𝐵 𝐵 𝐴 𝐶 𝐵 𝐴 𝐶 𝐴 𝐵 𝐶]
a) Draw the confusion matrix
b) Compute the accuracy and sensitivity per class
c) Considering class 𝐶, identify its precision and 𝐹1 -measure
d) Identify the accuracy, sensitivity, and precision of a random classifier