C3_W1 got zero for naive Bayes

Although I implemented all steps and got correct results as expected

1 Like

Please post a screen capture image that shows the grader feedback. You’ll need to click on each ‘>’ marker to have the text box appear.

1 Like

1 Like

I think there are at least two problems.
First in the code you showed, these two divisors are not correct.

Those should use the class_freq.

But that’s not what is causing the grader’s error about “np not defined”.

For some reason, somewhere in your code, you’ve added a reference to ‘np’ that the grader cannot resolve.

This sort of issue usually happens if you have added, deleted, modified, or re-arranged some of the cells in the notebook, or re-written some code that you should not have touched.

You’ll have to go over your notebook in detail, looking for areas where you may have made unintended modifications.

Worst-case, you may have to get a fresh copy of the notebook and start over. Instructions for this are in the “M4ML Resoures FAQ” thread - you can find it using the forum search tool.

thanks actually I deleted the first cell (imports) by mistake and recreated it.
I cannot find where/how to get fresh copy of assignment

It’s the first topic in this FAQ thread:

Thanks I was able to to get fresh copy.