I got correct logprior and loglikelihood values of 0 and 9165 respectively. However the immediate next unit test failed giving message “Sunglass” keyerror Expected 9165 elements in loglikelihood but got 148.
All subsequent cells as well as unit tests also ran correctly meaning there was no error in my code. Yet since the unit test failed, I got 0 score in train section of the assignment.
Thanks for the reply. But the error said found 148 loglikelihood elements when clearly the print statement gave 9165 as len(loglikelihood). How is that possible?
Also, when I said “meaning there was no error in my code” I meant that all subsequent function calls gave correct output.
Thanks. But what is returned is controlled by the assignment function. How will hard coded variable impact this ? Besides, all other function calls gave correct result.
Whats best to do in this case and what I would do is, go over that functions implementation once again and see yourself if all makes sense, next is go to files -open- and check the unit tests file if its there, that might give you some indication of where you are going wrong as well. Ultimately if all your efforts fail, a mentor might have to have a look at your code.
Thousands of learners have done this and passed.