Erron in an assignement even if all test passed

In the assignement “Practice Lab: Decision Trees”, all the test are passed but I got and error when submitting the pactice lab.

Anyone with the sam problem?

Hello Ivan,

can you share the screenshot of the error you got!!! So others can help you about.


Yes, this happens quite a lot. There are lots of threads about it.

Posting the grader feedback would be helpful. You’ll need to click on the > icon next to a function where you didn’t get full points, and that will show you what the grader is complaining about.

Please post a screen capture of that message.

Hi, thanks for your answer. This is the screenshot of the error I got

Your code for compute_entropy() is not correctly handling the case when the length of y is zero.

There is a hint about this in the notebook instructions.

Hi, actually my code consider that case, that’s why I’m stucked on it

The error message suggests you’re not handling it correctly.

You need to avoid dividing by len(y) if the length of y is zero.

Depending on how you write your code, you might consider using multiple “return” statements.

To be sure, I put exactly the code indicated in the hint. But I still have the error

Ivan is your resolved?