Skip to contents

Prepends a bias column, starts at zero, and runs n_iter full-batch gradient steps on the mean log-loss.

Usage

morie_geron_train_logreg(X, y, eta = 0.5, n_iter = 400, l2 = 0)

Arguments

X

(m, n) design without a bias column.

y

0/1 targets.

eta

Learning rate.

n_iter

Number of steps.

l2

Optional ridge on the non-bias coefficients.

Value

Numeric coefficient vector of length n + 1.

Examples

morie_geron_train_logreg(X = c(1, 2, 3, 4, 5, 6, 7, 8), y = 5L)
#> [1]  800.25  800.25 1600.50 2400.75 3201.00 4001.25 4801.50 5601.75 6402.00