You can use
abstain_below and action_costs together, on any decision.
A threshold in your code
Read the probability you need and compare it with your own threshold:Abstain below a threshold
Give a decision apolicy with abstain_below. When p_top is below it, the action is abstain, and
you hand the case to a person. Otherwise the action is the likeliest outcome.
policy block:
Weigh what mistakes cost
Give a decisionaction_costs: for each action, what it costs under each outcome. OneHot picks the
action with the lowest expected cost and returns it as policy.action, with every action’s expected
cost in policy.expected_costs.
Here the question is whether a £1,200 refund is fraudulent. Approving a fraudulent one costs 1,200, and a
review costs 15 either way:
- Give every action a cost for every outcome of the decision.
- A cost that is the same for every outcome, as
reviewhere, is how you price handing a case to a person. - With
abstain_belowas well, the action isabstainwheneverp_topis below it, whatever the costs. - The costs are yours: they say what mistakes cost your application, not how confident the model is.
Choose a threshold
A threshold is a trade. Set it higher and fewer cases are handled wrongly, but more go to review.- Collect a few hundred real cases and label the right answer for each.
- Score them once, without a policy, and keep the answers.
- For a few thresholds, count the wrong actions and the cases sent to review.
- Pick the threshold whose numbers your team can live with. Recheck it when you reword the decision or change the model.
Correct a lean towards one outcome
A model can pick one outcome too often, such as sending too many tickets tobilling. Before you train
a model of your own, try weighting the outcomes. A weight below 1 makes an outcome less likely to come
top.
- Count the outcomes picked when they were wrong, on the same labelled cases.
- Try a few weights for the outcome picked too often, and keep the one that gets most cases right.
- Check that weight on labelled cases you didn’t use to choose it.
