Wk4: UNQ_C3 AssertionError

I got the expected output, however an AssertionError as well:
What might be wrong, any tips?
Thanks.

Hi @Michio_Suginoo,

You are also seeing nan because in your compute_entropy, it does not handle the case when the length of y is zero. Please take a look at the last point of the notes:

Screenshot from 2022-07-12 11-25-29

Raymond

1 Like

Hi @rmwkwok
Thank you very much for your kind followup.
I really appreciate your advice.
My problem was that I missed out the last condition regarding an empty data.
I managed to fix my problem, thanks to your instruction.
Best regards,
Michio

1 Like

You are welcome Michio! :slight_smile: