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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started