pub struct Detector {
pub recall: f64,
pub false_positive_rate: f64,
}Expand description
A detector’s prevalence-independent behaviour.
Fields§
§recall: f64Fraction of genuinely bad merges it flags. Carries across populations.
false_positive_rate: f64Fraction of genuinely good merges it flags anyway. Carries across populations, and is the number that decides everything at low prevalence.
Implementations§
Source§impl Detector
impl Detector
Sourcepub fn from_reported(
precision: f64,
recall: f64,
prevalence: f64,
) -> Result<Self, String>
pub fn from_reported( precision: f64, recall: f64, prevalence: f64, ) -> Result<Self, String>
Recovers the prevalence-independent behaviour from a paper’s
reported precision and recall at that paper’s corpus
prevalence.
§Errors
Inputs outside 0.0..=1.0, a zero precision or recall (nothing to
recover), or a corpus prevalence of 1.0 (no negatives to have
produced the reported false positives).
Sourcepub fn precision_at(&self, prevalence: f64) -> f64
pub fn precision_at(&self, prevalence: f64) -> f64
Precision this detector reaches at prevalence.
Returns 0.0 when it would flag nothing at all, which is the honest reading: a detector that never fires has no precision to speak of.
Sourcepub fn false_alarms_per_hit(&self, prevalence: f64) -> Option<f64>
pub fn false_alarms_per_hit(&self, prevalence: f64) -> Option<f64>
False alarms per true alarm at prevalence — the number an
on-call human actually experiences. None when it never fires on
a true positive, so the ratio is undefined rather than infinite.