Build the tree

The tree building algorithm recursively partitions the data using questions.
For every possible question in your list of questions, split the data into the two corresponding partitions. Compute the entropy of each partition. Then compute the total entropy, which is a weighted sum of those two values. It will be tedious to try all questions manually, so you can take a short cut: use your intuition and just try those few questions that you think will work the best. Pick the best question, place it into the tree. Permanently partition the training data using it. Now simply recurse. You’ll need to set yourself a stopping criterion: for this toy data set, I suggest that you stop when all data points at a leaf have the same value for the predictee (i.e., zero entropy).

Video to be added after the lecture…

No ratings yet