Specificity of a Spam Classifier
Larkspur Mail promises business customers that ordinary correspondence gets through untouched. Legal wants that promise backed by a number before it goes into a contract, and the number has to be about genuine mail specifically - not about the filter's overall record. It is recomputed for each candidate build from that build's own bake-off run.
Throughout, spam is the positive class, so a "negative" is the filter deciding an email is ordinary mail and leaving it alone.
Task: Print the filter's specificity - the true negative 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 ordinary email.
Output
One line holding the specificity rounded to 4 decimals, printed the way Python prints a float - 0.75, never 0.7500.
Example:
Input:
40
10
45
5
Output:
0.8182
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