how to get decision tree and calculate the error of tree?

157 Views Asked by At

Recently i start to read the artificial intelligent book written by David poole and i am trying to solve some exercise from there. In exercise that "Suppose we have a system that observes a person’s TV watching habits in order to recommend other TV shows the person may like. Suppose that we have characterized each show by whether it is a comedy, whether it features doctors, whether it features lawyers, and whether it has guns. The examples about whether the person likes various TV shows are given in the table."

data: Data is here

This data is used to learn the value of Likes (i.e. to predict which TV shows the person would like based on the attributes of the TV show). Suppose we measure the error of a decision tree as the number of misclassified examples. The optimal decision tree from a class of decision trees is an element of the class with minimal error.

Now the question is: i would like to give the optimal decision tree of depth 1, with only one node. Note that a depth of root is 0, and suppose that the error is the 0/1 loss. What is the error of this tree?

I will be more than happy if anyone has some idea about to solve this.

Thanks