Recall of a Spam Classifier
Security at Larkspur Mail is asking the opposite question from the support team. They do not care what is sitting in the junk folder; they care how much spam reached a customer's inbox, because that is where the phishing links get clicked. They read the same bake-off runs the support team does, one candidate build at a time.
Throughout, spam is the positive class - a "positive" means the filter raised the alarm.
Task: Print the filter's recall for the spam class - also called sensitivity, or the true positive rate - as a single number rounded to 4 decimals. Round once, at the end.
Input
Four lines, each holding one whole number from a single evaluation run, in this order:
- spam, and the filter flagged it.
- real mail, and the filter flagged it anyway.
- real mail, and the filter let it through.
- spam, and the filter let it through.
Every run contains at least one genuinely spam email.
Output
One line holding the recall rounded to 4 decimals, printed the way Python prints a float - 0.75, never 0.7500.
Example:
Input:
40
10
45
5
Output:
0.8889
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in