Decision Tree Dataset Split

Hello guys,

It’s true that class materials of Week 4 were simpler and with actually minimal programming content and instructions - apart from plenty of pictures - in terms of how we program and model decision trees and that’s why I find the dataset split in week’s 4 assignment - cell 2 - highly complex and intuitive.

When I try to make the split, under no circumstances can I get 4 sets instead of 2. I used pen and paper to understand the visualization behind the math but nothing happens.

We have a 10x3 matrix and we need to append mushroom samples of 0-9 in terms of whether they give a 0 or 1 label. This means we need to visit or enumerate all elements of X and then split. But the second case described later on actually gives a subset of the total initial samples and calculates a second split. How can I get 2 cases instead of 1?

I have attached 2 screenshots.

I would appreciate an answer from someone who knows.

Best
M


Hi @Menelaos_Gkikas ,

You are supposed to access each sample’s feature from the training data set X. To do that, we write x[i][feature], where i is the ith sample from the training data set.
Please click on the Hints for guidance on how to implement this function, and it also set out how to code the condition clearly. Below is a screenshot for your information:

Thanks a lot Kic. Passed!

1 Like