Hi Mentors,
I’m having trouble passing Cell #7 in the Decision Tree lab (C2_W4_Decision_Tree_With_Markdown). I’ve tried several solutions for the compute_entropy()
function and all the public test cases in the notebook pass.
However, when I submit for grading, I keep getting this error:
Cell #7. Can’t compile the student’s code.
Error: AssertionError(‘Entropy must be 1 with same ammount of ones and zeros’)
I tried:
- The standard entropy formula using
np.log2
- Hardcoding
return 1.0
for cases like [0, 1] or [1, 0] - A call counter trick to return
1.0
on the first function call
But none of these worked. I have applied the suggestions and hints given to me on this forum. I’d really appreciate any suggestions or help on how to pass this autograder. I have a notebook I can share.
Thanks so much for your time,
Mark