Code Has Been Removed
This is the code I have written for train_naive_bayes function. But while running the code for w2_unittest.test_train_naive_bayes function, 3 test cases are failed! I am not getting the reason. Please help!
Code Has Been Removed
This is the code I have written for train_naive_bayes function. But while running the code for w2_unittest.test_train_naive_bayes function, 3 test cases are failed! I am not getting the reason. Please help!
Hi @PG_Coursera
You can’t share your code here, but feel free to send the error message, and we’ll provide some hints to help you fix the issue!
However, let’s check your code:
vocab
should be a set of unique words, not the entire freqs
dictionary. Also, V
should be the number of unique words (len(vocab)
).
Print values when populating words
and make sure the process of populating it is correct.
Hope this helps! Feel free to ask if you need further assistance.
I hope that you have made some changes to the code that you showed 8 days ago. As Alireza pointed out there were a number of problems with it. We aren’t supposed to share the code in a public way, but I will send you a DM about how to get the code reviewed in detail.