sellab
Evaluating a release rule from the released alone
sellab(y, rel, rule, w = NULL)crimlab.sellab(y, rel, rule, w=None)crimlab sellab --y VALUE --rel VALUE --rule VALUE [--w VALUE]Failures (a missed court date, a new arrest) are seen only for the
defendants a judge released. A proposed rule that releases only people
the judge released is scored exactly from their outcomes; one that
releases people the judge detained has a failure rate known only up to
the worst and best cases for them, an interval whose width is the share
of the rule’s releases the judge detained. Both ends can occur. The
naive score on the rule’s observed releases alone always lies inside the
interval, but reports one point of it as if it were known. See
proof("sellab").
Parameters
Section titled “Parameters”yFailures: 1 or 0 for each released defendant; values for detained defendants are ignored and may be
NA.relReleased by the judge:
TRUEorFALSEfor each defendant. Wheny,rel,rule(andw) are all named with unique names, they are matched by name; otherwise by position.ruleReleased by the rule:
TRUEorFALSE, same length.wNULLfor equal weights, or one non-negative weight per defendant.
Returns
Section titled “Returns”A named numeric vector: obs (the failure rate among the judge’s
releases), unobs (the share of the rule’s releases the judge
detained), lower and upper (the bounds on the rule’s failure rate),
width (upper - lower, equal to unobs) and naive (the failure
rate on the rule’s releases that were observed; NaN when none were).
References
Section titled “References”Lakkaraju, H., Kleinberg, J., Leskovec, J., Ludwig, J. and Mullainathan, S. (2017). The selective labels problem. Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 275-284. doi:10.1145/3097983.3098066
Examples
Section titled “Examples”set.seed(4)risk <- runif(500)y <- rbinom(500, 1, risk)sellab(y, rel = risk < 0.7, rule = risk < 0.8)Generated from the R help page: sellab in the R reference.