Hi Raymond,
Thanks again for your help and encouragement with this lab. I’ve been working through the assignment and trying to follow your advice about using prints and logic checks to figure things out.
I wanted to share two issues I’m running into when trying to pass all the autograder tests:
-
Cell #9 – If I leave split_dataset() as-is, the grader crashes when it calls generate_split_viz(). I fixed this by adjusting the function so it always returns something (like moving one sample over if one side is empty). After that, Cell 9 runs and doesn’t crash. (See screenshot 1)
-
Cell #12 – The problem is, once I make that fix, the output from compute_information_gain() changes slightly and then the unit test fails because the expected value is different. (See screenshot 2)
I added print() statements inside the cells while testing and was able to get all the outputs to look correct when I ran them myself — so I think the logic works, but the autograder is catching the conflict between the two cells.
I only changed code between the ### START CODE HERE ### and ### END CODE HERE ### sections. I’ve attached the screenshots here, and I can also send the notebook file if that helps — just let me know.
If you have any suggestions or tips on how I can get both of those cells to pass at the same time, I’d really appreciate it!
Thanks so much again,
Mark