C2_W4 error,but I have finished all the tests.What happened?

When creating a post, please add:

  • Week # must be added in the tags option of the post.
  • Link to the classroom item you are referring to
    :/notebooks/C2_W4_Decision_Tree_with_Markdown.ipynb
  • Description (include relevant info but please do not post solution code or your entire notebook):

@Xaiver, sorry for the delay! Did you figure this out already?

The error you’re seeing:

   ValueError: not enough values to unpack (expected 2, got 0)

for the zip() function is telling you there is nothing for zip to unpack - which means the images list for node_indices must be empty. That matches what we see in the print statements above where you have:

-- Right leaf node with indices []

I’d start by looking at why the node is empty - when you build the tree, there should be something in both the left and right nodes.

One suspicious thing I noticed in your print statements - it says “Split on feature: -1”. The feature number shouldn’t be negative. That’s probably a hint as to what’s causing the splitting to give you an empty node.