Guided Project: Building a Spam Filter with Naive Bayes

Screen Link: https://app.dataquest.io/m/433/guided-project%3A-building-a-spam-filter-with-naive-bayes/7/calculating-parameters

Your Code: Guided Project_ Building a Spam Filter with Naive Bayes.ipynb (267.1 KB)

What I expected to happen: I expected an error free code

What actually happened: I got a KeyError message

Other details: smsspamcollection.zip (198.6 KB) . I have uploaded the data set and my notebook. kindly assist resolve the KeyError message

Click here to view the jupyter notebook file in a new tab

Hi @photonsinnovate

Can you upload your Notebook? I didn’t find it inside the zip file.

Or you can see my Notebook here.

Guided Project_ Building a Spam Filter with Naive Bayes.ipynb (267.1 KB)
Hi prem1234,

Find attached my notebook

Click here to view the jupyter notebook file in a new tab

Hey @photonsinnovate

Check cell 13 where you are filtering spam_messages and ham_messages, you have to use concatenated dataframe (training_set_clean) not the training_set.

I hope this helps :slightly_smiling_face: .

Many thanks. You just made my day!

1 Like