Turn class probabilities into decisions under unequal costs and an "I don't know" action. Correct decisions cost .
cost_threshold(c_fp, c_fn): the probability above which predicting has lower expected loss than predicting , when a false positive costs c_fp and a false negative costs c_fn.chow_decide(probs, reject_cost, error_cost): probs has shape (n, C). Any wrong label costs error_cost () and rejecting costs reject_cost (). Following Chow's rule, predict the most probable class when its probability satisfies ; otherwise return (reject). On ties for the most probable class use the lowest index. Return an integer array.binary_decide_with_reject(p1, c_fp, c_fn, c_reject): for an array of , compare the expected losses of predicting (), predicting () and rejecting (). Return an integer array with , , or for reject; on exact ties prefer , then , then reject.risk_coverage(probs, y, thresholds): for each threshold , accept the examples whose largest class probability is at least and predict their most probable class. Return two float arrays: coverage (fraction accepted) and selective error (error rate among accepted examples, if none are accepted).