Skip to contents

sigma(theta^T x) with the overflow-safe two-branch sigmoid. The decision boundary is the linear set theta^T x = 0.

Usage

morie_geron_logistic_probability(X, theta, add_bias = FALSE)

Arguments

X

Design matrix (a vector is one row).

theta

Coefficients.

add_bias

Prepend a ones column.

Value

List with p_hat, logits, prediction (0/1), estimate, n.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_logistic_probability(V, V)
#> $p_hat
#> [1] 1
#> 
#> $logits
#> [1] 204
#> 
#> $prediction
#> [1] 1
#> 
#> $estimate
#> [1] 1
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "Logistic regression probability"
#>