C2_W4_Decision_Tree Practice Lab error when Submitting

Hello, Mark!

How’s the day? I am having a very good morning. :smiley:

Although I have read through your whole message, my response will just focus on the following part and I will explain why:

Your adjustment seems to suggest that your split_dataset had returned empty list and that crashed generate_split_viz. Given this, my suggestion would be not to “adjust”, but to make sure the logic for split_dataset is correct.

First, I can guarantee you that no test, and I mean no test, expects split_dataset to return any empty list. This means that if you test split_dataset with the assignment’s test cases and if your implementation of split_dataset is correct, it won’t return empty list and generate_split_viz won’t crash.

Second, just now, I submitted that assignment and scored 100%, so I hope you will believe that the way out of this was not to silent error by adjustment, but to make sure the work is correct and this is what assignment is for. :wink:

Here is what I would suggest you to do:

  1. Last time, you had shared expectation that I couldn’t find any test that produced them, so I wonder if it was a case not from the original notebook. This time, your screenshot seems to suggest that it was not a Coursera environment. please open the notebook on Coursera, follow these steps to get a new copy of the notebook.

  2. Copy the working solution for exercise 1 to the new notebook, then work on exercise 2 and only make changes between the ### START CODE HERE ### and ### END CODE HERE ### lines

  3. Add print in between each line of your code to show what the line has achieved and if the achieved result sticks to what is worked out by yourself.

  4. Run the tests in Cell #9 and if any test fails, debug it, and if any problem comes up, share a screenshot of the problem (including the whole error message).

  5. Only after you clear Cell #9, proceed to subsequent cells and exercises. (This is why I don’t respond to your message about your Cell #12 because exercise 4 depends on a correct exercise 3 and exercise 3 depends on a correct exercise 2, so we need to clear exercise 2 first.

Mark, I would just like to make two more points:

  1. When you take screenshot to share here, what we want to see is the output coming from the notebook on the Coursera environment. Your last screenshot apparently isn’t that. If you can’t share that screenshot we need, we wouldn’t be able to help you.

  2. As you see, we are exchanging messages once every one to a few days, and I probably won’t come here in the next couple of days, so if you have any follow-ups, I would recommend you to open a new topic so that other participants of this forum are more likely to respond.

Cheers,
Raymond