All problems

False Positive Rate of a Spam Classifier

easyPythonML Metrics

Larkspur Mail runs a capacity meeting every quarter, and one line on the agenda is the review queue: every genuine email the filter wrongly quarantines eventually costs an agent a few minutes. To forecast that queue the operations team needs the rate at which ordinary mail gets caught by mistake, for whichever build is being considered.

Throughout, spam is the positive class, so a false positive is a genuine email that the filter flagged anyway.

Task: Print the filter's false positive rate - the rate measured across genuine mail, not across everything the filter flagged - 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:

  1. spam, and the filter flagged it.
  2. real mail, and the filter flagged it anyway.
  3. real mail, and the filter let it through.
  4. spam, and the filter let it through.

Every run contains at least one genuinely ordinary email.

Output

One line holding the rate rounded to 4 decimals, printed the way Python prints a float - 0.25, never 0.2500.

Example:

Input:
40
10
45
5

Output:
0.1818

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

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…