Question: java programming: Consider the case of a spam detector for a receiving email. The 2% of the email we receive is spam. When an email

java programming:

Consider the case of a spam detector for a receiving email. The 2% of the email we receive is spam. When an email is spam it is detecting with accuracy of 99%. When an email is not spam, it will mark as spam with a very low rate of 0.1%. Please prepare a program (spamdet.java) that can find the probability of an email to be in fact spam if it is in the spam folder.

Hint: the formula that should be used is:

P(Spam/Detected) = (P(detected/Spam) * P(Spam) ) / P(Detected)

Variables for the program:

pSD = P(Spam/Detected), p(DSpam) = P(detected/Spam) , pSpam = P(Spam), pD = P(Detected).

Please create a method that can find the pSD.

Create a class. A method that use the formula. Method: pSD(pSpam, pDSPam, pDNoSpam)

Consider the: double pNoSpam = 1 pSpam;

Results should look like this:

pNoSpam:

pD: 0.02

pSD: 0.95

result 0.95

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!