C2W4 Practice Lab - Division by zero error

I encountered a ‘division by zero’ error in the final lab of the course Advance Learning Algorithms. Although compute_entropy function passed the test, compute_information_gain gave a zero divisor error related to compute_entropy. Furthermore, expected output are the same with the function output.


Could please you help me with this issue?

Hi @tugcemrc

You should ensure thatcompute_entropy is not called on an empty set of labels. For this, you must do exactly what rhe instructions say.

Hope it helps! Feel free to ask if you need further assistance.

Thanks @Alireza_Saei . It has been solved.

1 Like