Hello Mentors,
I’ve been working hard to complete this Decision Tree lab and wanted to share the steps I took in case you can help me figure out why Cell #7 keeps failing after submission.
- I followed the Coursera notebook step-by-step and used the provided hints to write code for each of the 4 graded exercises (
compute_entropy,split_dataset,compute_information_gain, andget_best_split). - I ran the test cells after each exercise individually, and all the tests passed (including the expected output from Cell #8 for entropy:
1.0). - After completing all exercises, I clicked Restart and Run All to cleanly re-run the entire notebook in top-to-bottom order.
- I then submitted the notebook, but I’m still getting an error in Cell #7:
“AssertionError: Entropy must be 1 with same amount of ones and zeros” - I also saved the notebook to a folder and can upload it here if needed.
Would it help if I added print() statements inside the graded cells? I ran each one independently before the final restart and all the results looked correct.
Thank you for taking a look — I’m just trying to understand what’s causing this error even though everything works when I run it manually. I also used an updated notebook in the lab.
Best,
Mark
