Recommend a threshold for a precision or recall target
The threshold on p as answers read it (the engine’s p; a
composite’s combined p; a bool with features’ calibrated p), or on
raw dist[option] (choice), that meets the target on the active
version’s outcomes. A document counts as predicted positive
when that value is at least the threshold, and as positive when its
outcome is true (bool) or equals option (choice).
- For a precision target, the lowest threshold whose precision meets it, which keeps the most recall.
- For a recall target, the highest threshold whose recall meets it, which keeps the most precision.
For a choice with options.from the threshold is
on raw escape_p, the unmatched queue, and option is
none_of_the_above or left out. A document whose escape_p is
below the threshold has its pick taken; at or above it, it waits in
the queue. Precision is the share of taken picks that equal the
outcome, and recall the share of outcomes naming a match whose pick
was taken and right, so a precision target takes the highest
threshold that meets it, and a recall target the lowest. Apply it as
{"unmatched": {"value": "none_of_the_above", "gte": threshold}}.
The recommendation rests on the outcomes of the current engine epoch:
at least 100, with at least 20 positive and 20 negative (for a choice,
20 of option and 20 of the other options). When that epoch has too
few, it uses the previous epoch’s and says so with
from_previous_epoch, as calibration does. When neither has enough,
insufficient_data says why and what to post. Nothing
changes until the threshold is applied with PATCH. Score judgments have no recommendation (invalid_request).
The recommender is one of the outcome tools, on the Team plan and
above: below it, plan_required. The calibration report and
calibrated answers are on every plan. Like the report, it reads every
outcome posted so far, and answers unavailable when that takes too
long.
Authorizations
An organization API key. Keys carry a role (read_write or
read_only) and may be restricted to a namespace prefix such as
acme/*, or to one namespace such as acme/prod/tenant_1. A prefix
matches on a / boundary: acme/prod/tenant_1* covers
acme/prod/tenant_1 and everything under acme/prod/tenant_1/,
never acme/prod/tenant_12.
Path Parameters
A namespace name, or a template prefix ending in /*, with any
/ sent as %2F: acme%2Fprod%2Ftenant_123 or acme%2Fprod%2F*.
A namespace name, or a template prefix: a namespace path ending in
/*, such as acme/prod/*, which every namespace under acme/prod/
inherits judgments from. Up to 256 bytes. Never exactly
. or .., which a URL path can't carry.
1 - 256^(?!\.\.?$)[A-Za-z0-9._:/-]+(/\*)?$Query Parameters
A bool judgment with features only, and not with option: one
of its features. The response is then the cut on that feature
that meets the target, as a feature threshold applies it, with the
recommendation on p for the same outcomes beside it.
One number the judgment records beside every answer and its fit can read. It is one of:
- An aggregate the recipe declares, as
<relation>.count,<relation>.count_where,<relation>.labelledor<relation>.<sum|avg|min|max|latest>(<path>), such astickets.countorinvoices.sum(state.amount). Aminormaxover an answer'sporscoregives the raw extreme, whatever band the context shows; alatestover an answer's threshold reads 1 or 0. Alatestover an answer'svalueis not a number and isinvalid_request. Asumoravgover an answer's number is a feature only. Alatestover abooloutcome reads 1 or 0, over ascoreoutcome its level; over achoiceoutcome it isinvalid_request. - The judged document's own value,
state.<path>orattributes.<name>: a number as itself, a boolean as 1 or 0, anything else missing. It needs no relation. - An age in fractional days,
age(created_at),age(<state or attributes path>)orage(<relation>.<latest|min|max>(<path>))over an aggregate the recipe declares. It is measured as of the judged document's ownupdated_atat the revision judged, so a write to a related document never moves it, and a new revision of the judged document does. The value must be an RFC 3339 string; a number or any other value reads missing, and a later time reads negative.age(updated_at)isinvalid_request: as of the judged revision it is always 0. previous.p: the engine's ownpthe last time it judged the document with the same engine version, in the same life of the document; on a choice, its1 - escape_p. Missing on the first judgment, after the document is created again, after the engine version changes, and on a composite, which has none. On a score it isinvalid_request.- On a choice among candidates (
options.from) only, a number per candidate,<from>.each(<path>)over theoptions.fromrelation: each candidate'sstate.<path>orattributes.<name>, orage(created_at),age(updated_at)orage(<state or attributes path>)of the candidate, as of the judged document's revision. It is recorded for each candidate the engine read, under the answer'scandidate_features. A candidate's answers areinvalid_request: keep the number on the candidate's state.
A name the recipe declares as an aggregate always reads that
aggregate. A feature that reads a path an outcome rule reads, one
inside the other, is invalid_request.
^([A-Za-z0-9_-]+\.(count|count_where|labelled|(sum|avg|min|max|latest)\((state|attributes)(\.[^.()]+)+\)|(min|max|latest)\((created_at|updated_at)\)|(sum|avg|min|max)\(answers\.[A-Za-z0-9_-]+\.(p|score|dist\.[^()]+)\)|latest\(answers\.[A-Za-z0-9_-]+\.thresholds\.[A-Za-z0-9_-]+\)|latest\(outcomes\.[A-Za-z0-9_-]+\.value\))|(state|attributes)(\.[^.()]+)+|age\((created_at|(state|attributes)(\.[^.()]+)+|[A-Za-z0-9_-]+\.(latest|min|max)\((created_at|updated_at|(state|attributes)(\.[^.()]+)+)\))\)|previous\.p|[A-Za-z0-9_-]+\.each\(((state|attributes)(\.[^.()]+)+|age\((created_at|updated_at|(state|attributes)(\.[^.()]+)+)\))\))$Response
A recommendation, an unreachable target, or too few outcomes; status says which. With feature, a FeatureThresholdRecommendation.
- Option 1
- Option 2
- Option 3
- Option 4
Apply threshold with the judgment PATCH: {"escalate": threshold} for a bool judgment, {"fraud": {"value": option, "gte": threshold}} for a choice.
Precision at the threshold, read on outcomes the choice of threshold never saw: the outcomes are split five ways, the threshold is chosen again on four parts and read on the fifth, and the reads are pooled. It is usually a little under the curve's point at the threshold, which is read on every outcome, and can be under the target: it is what to expect on new answers.
0 <= x <= 1queue when the epoch's labelling-queue labels alone number 100,
with 20 of each class: the recommendation then rests on them only,
each weighted back to your real traffic, and its interval comes
from how many labels each band has and how common the band is.
Otherwise all: every outcome, each counting once.
all, queue A bool's p only. labels_do_not_cover when more than 20% of
the live answers it would select have a raw p outside the
range the labels cover, so the claimed precision says nothing
about much of what the threshold acts on. The threshold is
still given, and can be applied. Null when the labels cover
what it acts on.