Calibration

How Finic's scores and answers match your own fraud rates. Calibrating a scoring model with labeled records, base rates for questions, and choosing thresholds.

Finic's answers are calibrated: a score of 250, or a probability of 0.25, means about a 25% chance. Of records scored near 250, about 1 in 4 turn out bad; of answers near 0.8, about 8 in 10 are right. And they're calibrated to your distribution:

  • A scoring model is fitted to your labeled records, each time you send them. Until its first calibration, its scores rank records, but their scale is Finic's estimate, not yet your rate.
  • An answer shifts to your rates when its question carries a base_rate.

Calibrate a scoring model

A scoring model is calibrated to the labeled records you send: past records with the fields of the records it scores, each with is_bad. Creating it from labeled records is its first calibration. One created from its criteria isn't calibrated until you first calibrate it (A scoring model's first calibration). If your records have more bad outcomes than production does (say, you included every bad case you have), scores run higher than the true rate. Records still rank the same way, so thresholds chosen on your own records still work, and calibrating with a representative set corrects it.

Calibrate with POST /v1/calibrate, sending the records in data (or as a file in the multipart file part), by the same rules as for creating: at least 100 rows with 20 of each outcome, up to 2,000 used. Grayson answers all the scoring model's questions, and yours, for every record, and the scoring model again uses the ones that best predict the outcomes, so your questions it doesn't use are tried again.

curl https://api.finic.ai/v1/calibrate \
  -H "Authorization: Bearer $FINIC_API_KEY" \
  -F model_id=scm_01M4XRC000RT2GZSKYPD8J86G9 \
  -F file=@labeled.csv \
  -F add_questions="Was the account opened less than a week before the payment?" \
  -F remove_questions=q022
  • It runs as a job, in about two minutes. Scores already returned don't change; score calls after the job completes use the updated scoring model.
  • The response has rows, the number of records used.
  • Records must match the scoring model's schema, if it has one; if one doesn't, the request fails with 400 schema_mismatch.
  • Up to 10 calibrations per scoring model per day, one at a time.
  • It can add and remove questions, with add_questions and remove_questions (repeat them in a multipart form, one per question); add_questions adds them without calibrating. See Changing questions.
  • The records are kept encrypted only while the job runs, as when creating, and deleted when it ends. If maintenance interrupts the job, it runs again.

A scoring model's first calibration

A scoring model created from its criteria has only your own questions, weighed by Finic's estimates, until its first calibration. That calibration also has Finic write questions from the records, and the scoring model keeps the ones that predict best, from those and yours, as when creating from labeled records. The records give it its schema.

How each calibration did

Each calibration, creating from labeled records included, records how the scoring model did, shown on its page in the Finic app as a precision-recall curve. It's measured on the records sent, each scored by a scoring model fit without it.

Base rates for questions

Any question can carry base_rate: how common each answer is in your cases. Finic then shifts that question's probabilities from their usual average to your rate. Cases keep their order, so the same cases rank highest; only the probability levels move. Use it when your rate differs from what the answers average: for example, fraud is confirmed on 0.3% of your alerts, but answers to is_fraud average 2%.

"questions": {
  "is_fraud": { "type": "noul", "instructions": "Is this payment fraudulent?", "base_rate": 0.003 },
  "claim_type": {
    "type": "choice",
    "instructions": "What kind of claim is this?",
    "criteria": { "ato": "Account takeover", "first_party": "First-party fraud", "none": "Not fraud" },
    "base_rate": { "ato": 0.1, "first_party": 0.05, "none": 0.85 }
  }
}
Typebase_rate
noulThe share of cases that are yes: a number strictly between 0 and 1
choiceEvery option's key with its share, each from 0 to 1, adding up to 1 (within 0.02; scaled to exactly 1)
multi_choiceAny option keys, each with the share of cases it applies to, strictly between 0 and 1, independently. Options left out aren't shifted

A share of 0 makes that answer all but impossible: use it only for answers that never happen.

How it works

  • Finic keeps a running summary of its answers to each of your organization's questions: how they're spread, over roughly the latest 200, weighted to the most recent. Every answer updates it, with or without a base rate.
  • A base rate applies once the question has 30 answers. The answer then has calibrated: true; before that, calibrated: false and the probabilities are unchanged. Questions without base_rate have no calibrated field.
  • Every answer moves by the same amount on the log-odds scale, chosen so the recent answers average your rate (per outcome for a choice, then renormalized). An answer already at your rate is left alone.
  • A question is recognized by its name, type and option keys. Rewording the instructions or descriptions keeps its summary; renaming it, changing its type or changing its options starts a new one, which needs 30 answers again.
  • Each request uses the base rate it sends, so update it as your rates drift.
"is_fraud": { "type": "noul", "noul": 0.0041, "calibrated": true }

Choosing a base rate: measure it on your own data, on the same cases you send (if you only send alerts a rule flagged, the rate among those alerts). A rate close to the truth improves the probabilities; one several times off makes them worse than none.

What's stored: the summary, per organization, under a one-way hash of the organization and the question's name, type and option keys. It holds only aggregates of the answers: no single answer, question text, data or base rate. Unused summaries are deleted after 180 days.

Errors: an invalid base rate gets 400 invalid_request with param questions.<name>.base_rate:

Causemessage
A yes/no rate of 0 or 1, or not a numberA yes/no question's base_rate is the share of cases that are yes, between 0 and 1 (not 0 or 1).
A choice's shares don't add up to 1A choice's base_rate shares must add up to 1.
A choice's rate leaves out an optionA choice's base_rate gives every option a share, and the shares add up to 1.
A key that isn't an optionbase_rate names "wire", which isn't one of the question's options.

The playground has base rates too: turn on Add base rate on a question.

Choosing thresholds

Finic returns probabilities, not decisions: you choose where to act.

  • Choose on your own labeled records, each cut at the time of the decision: the threshold that gives the review volume, catch rate or losses you want. Check calibration on that sample before relying on it.
  • Use one threshold per action: for example, decline a score above 800 and review above 300, or block on an answer above 0.9 and review above 0.3.
  • Add base rates first. They change the probabilities (not the order), so a threshold chosen without one catches a different share with it.
  • For a choice, look at the margin: 0.48 against 0.45 is a close call.

On this page