Question: Implement a simple Bayesian Spam filter and determine if each email in the 'test' folder is spam or ham. - In the 'train' folder, two
Implement a simple Bayesian Spam filter and determine if each email in the 'test' folder is spam or ham.
In the 'train' folder, two files contain spam and nonspam messages.
In the 'test' folder, two files contain spam and nonspam messages.
We want to classify emails in the 'test' folder based on the emails in the 'train' folder.
Thus, probabilies should be calculated from emails in the 'train' folder.
Please ignore all special characterseg~@#$&
Use C or C No other programming language is allowed. ex python, Java, etc
Procedue for decision.
Per each email from test forder
calculate rw wn and apply a threshold.
assign a label spam or nonspam which is a predicted label.
Calculate the accuracy of your prediction.
the number of correctly classified test emails divided by
since we have test emails spam and nonspam
For fun, let's try various 'threshold T for decision.
T
This means that we will have accuracies.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
