Skip to contents

y_hat = 1 iff p_hat >= threshold; the boundary goes positive.

Usage

morie_geron_ch4_logistic_regression_prediction(p_hat, threshold = 0.5)

Arguments

p_hat

Probabilities in [0, 1].

threshold

Cut in [0, 1].

Value

List with y_hat, positive_rate, margin.

Examples

morie_geron_ch4_logistic_regression_prediction(c(0.2, 0.5, 0.9),
    0.5)
#> $y_hat
#> [1] 0 1 1
#> 
#> $positive_rate
#> [1] 0.6666667
#> 
#> $margin
#> [1] -0.3  0.0  0.4
#> 
#> $threshold
#> [1] 0.5
#> 
#> $estimate
#> [1] 0 1 1
#> 
#> $n
#> [1] 3
#>