C2_W4_Decision_Tree_with_Markdown grading failsils although code

I have completed all the graded cells and the tests pass and show the expected output. However, when I submit the lab for a grade, it comes back with errors. Need guidance to troubleshoot and submit assignment for grade.

Code Cell UNQ_C1: Unexpected error (TypeError(“compute_entropy() got an unexpected keyword argument ‘y’”)) occurred during function check. We expected function compute_entropy to return compute_entropy test 1 failed. Please check that this function is defined properly.

Code Cell UNQ_C2: Unexpected error (TypeError(“split_dataset() got an unexpected keyword argument ‘X’”)) occurred during function check. We expected function split_dataset to return split_dataset test 1 failed. Please check that this function is defined properly.

Code Cell UNQ_C3: Unexpected error (TypeError(“compute_information_gain() got an unexpected keyword argument ‘X’”)) occurred during function check. We expected function compute_information_gain to return compute_information_gain test 1 failed. Please check that this function is defined properly.

Code Cell UNQ_C4: Unexpected error (TypeError(“get_best_split() got an unexpected keyword argument ‘X’”)) occurred during function check. We expected function get_best_split to return get_best_split test 1 failed. Please check that this function is defined properly.

If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps. This dependency may be the cause of the errors.

Have you changed the file name of your notebook from the default?

I have not changed the filename. the filename and LabID details are as follows:

Assignment name = C2_W4_Decision_Tree_with_Markdown
Lab ID = idbidksxlnuh
File location = /notebooks/C2_W4_Decision_Tree_with_Markdown.ipynb

Have you tried restarting the kernel and then submitting for grading?

Yes, rebooted the kernel, cleared the browser cache, rebooted the laptop, even tried submitting from another computer. I am at a loss for ideas.

After you restart the kernel, then run all of the cells, does your code pass all of the tests in the notebook?

Yes all the graded cells pass

Check your PM’s for a message.

{moderator edit; reply deleted}

1 Like

Please do not post your code on the public forum. That’s not allowed by the Code of Conduct.

my apologies. misinterpreted the request. How do I get this over to you or the right folks that can help me troubleshoot this issue.

Summary for others who may find this thread:

  • Do not modify any of the code outside of the “START CODE HERE” and “END CODE HERE” markers.
  • Specifically, do not change the variable names used in the function definitions.
1 Like

I seem to have the same issue. I might have accidentally changed the code and ended up having the same situation. Can you please let me know how I can solve it?

  • Rename your current notebook ipynb file.
  • Use the Help menu to get a new copy of the notebook.
  • Open two browser tabs, one with your old notebook, and one with the new notebook.
  • Copy the code segments you added from the old notebook, and paste them into the new notebook.

a tip from someone else who had this problem.

rename the broken notebook to something else

go to the week 4 course material and open the practice lab from there. this should give you a fresh start.

declare all your variables inside the ‘start code here’ and ‘end code here’ tabs. DO NOT type anything of your own outside this bracket, just to be safe. whatever you need to type, do it inside this bracket.

thanks for the help TMosh!
i was scratching my head for days figuring out the problem, lol