All problems

Specificity of a Spam Classifier

easyPythonML Metrics

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:

  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 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

Discussion

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

Loading comments…