Skip to contents

Toxicity metrics (Kamath Eq 6.23-6.25)

Usage

morie_kamath_ch6_emt_metric(Yhat, c)

morie_kamath_ch6_toxic_fraction(Yhat, c, threshold = 0.5)

morie_kamath_ch6_toxicity_probability(Yhat, c, threshold = 0.5)

Arguments

Yhat

Generations.

c

Classifier or score vector.

threshold

Toxicity cut-off; default 0.5.

Value

List with estimate, scores.

Details

One scorer serves all three Python modules exactly as km099 and km100 import km101's _scores/_flags: km099 -> morie_kamath_ch6_emt_metric (max toxicity), km100 -> morie_kamath_ch6_toxicity_probability (share of draws with at least one toxic generation), km101 -> morie_kamath_ch6_toxic_fraction (share of generations at or above the threshold). argmax_index is 0-BASED.

Examples

morie_kamath_ch6_emt_metric(c("a", "b", "c"), c(0.1, 0.9, 0.4))
#> $estimate
#> [1] 0.9
#> 
#> $argmax
#> [1] "b"
#> 
#> $argmax_index
#> [1] 1
#> 
#> $scores
#> [1] 0.1 0.9 0.4
#> 
#> $n
#> [1] 3
#> 
#> $method
#> [1] "Expected Maximum Toxicity (Kamath Eq 6.23)"
#>