Mistake in the code of week 4 assignment

You have to correct your code :

the original parameter to the generate_split_viz is " root_indices " and it should be root_indices_subset . this is causing the wrong plot in the root of the tree of case 2

Hello @Zvi_Boiangou,

You have posted this as a new thread in the Machine Learning Specialization (MLS). However, the code does not seem to come from the MLS. Were you going to reply to an existing post in another category? Which post was it?

Cheers,
Raymond

hello ,

i wanted to past the issue regarding the mistake in the code. i wrongly closed the question therefore i have added it to the reply , this is instead of filing a new issue.

Regards

Zvi

this code is part of the last assignment of week 4.

So you are having the discussion in this post right? I assume we can close this one now?

Raymond

No , i reported this cause this code should be fixed.
i can file a new ticket but i think we can do with this one.

Did you see the issue that i am reporting ??

I don’t see the issue you mentioned in your OP. I think maybe you modified that cell accidentally? Here’s what’s in a fresh copy of the notebook:

This notebook has not been updated since August 2022.

Yes indeed. i have modified it, you can see from your fresh picture that the 1’st parameter of the generate_split_viz proc is the same in both case1 and case 2 . THIS is NOT correct , the case 2 1’st parameter should be root_indices_subset , in this case one will get 2 different trees with different sizes.

Sorry, I am confused.
Can you please state clearly what you are requesting?

  • What is the problem?
  • What is your proposed solution?

I see what you’re saying, @Zvi_Boiangou,
For case 2, we’re supposed to be visualizing this line of code:

left_indices, right_indices = split_dataset(X_train, root_indices_subset, feature)

so we should be using root_indices_subset as our starting point, not, root_indices

Thanks for catching this. I’ll report to the developers so they can update case 2.

Yes indeed. Thanks for your help .it seems people did not watch the 2’nd picture of case 2 .

@Wendy, thanks for helping to sort out this issue. I was entirely looking at this thread backwards!