Train naive bayes: Failed default_check. Expected: 9165, but got: 9165

Hello All,

I am stuck on this. I have tried to use int() on some places, but I always get grade 0 and the following:

Failed default_check. Expected: 9165, but got: 9165. Failed smaller_check. Expected: 9165, but got: 9165. Failed smaller_unbalanced_check. Expected: 9165, but got: 9165.

I don’t know what else to do. Can someone help me?

Thanks

1 Like

Hi @cserranobr,

Can you share your lab ID with me ? In the assignment, when you click the top right “Help” button, a panel will open and your lab ID will be shown at the bottom.

I shall take a look.

When you reply back, kindly tag me in the post so that I’m notified.

Thanks,
Mubsi

Hi Mubsi,

Thanks! @Mubsi

pkdjxndo

Regards,
Carlos.

Hi Mubsi,

Good morning!

Did you check it?

Regards,
Carlos.

Hi @cserranobr, on it.

Hi @cserranobr,

I have made some changes to your UNQ_C2, see if they help.

Best,
Mubsi

Hi Mubsi,

Thanks! It helped indeed.

I see the difference was the use of set. I did the same via other means. I can’t still really understand the error message with " Expected: 9165, but got: 9165". Could you please explain it?

Because the below is a len and it should be just an integer, rigth?

print(len(loglikelihood))

Regards,
Carlos.

1 Like

Hi @Mubsi Sorry, I met the same problem, could you help me to take a look?
Lab ID: sruzvehw

Thanks ahead!

Hi @helenhe,

I’m glad after looking at your notebook that you had your issue fixed.

Happy learning,
Mubsi

NVM found my mistake already :smiley:

Hi, I have the same problem.

lab id: ppprswoi

Thanks,
Dor

NVM, found my error

But I’ll write to whomever get a similar issue: the output (“Expected 9165, but got 9615”) is not informative, there is probably another error in the code. At first glance I thought it’s a type related issue (it’s not, both 9615 are integers).

For the team: it’ll be helpful to get more informative feedback. I spent a lot of time thinking it’s some bug, as an actual bug popped up in the last test of this assignment (the test looked for a key ‘:D’, but word_list has all its keys processed, thus the key should be ‘:d’; I’m still failing with this test, still don’t know if it’s another bug or a mistake I’ve made).

I have the same issue, the unittests fail, and when I submit my solution if fails in ‘Train naive bayes’ tests (0/10).
Not sure what is the problem in my solution…

my lab ID is moadrajwpqqj

This is a very old thread and Mubsi is a pretty busy guy. Note that only the course staff have the “superpower” to look at someone else’s notebook directly. For the mentors, we need to take a different route. Please check your DMs for a message from me about how to proceed.