
Lasso cost (Geron Eq 4-10, morie.fn grlaso)
Source:R/geron_train_native.R
morie_geron_lasso_cost.RdJ = MSE + alpha * sum_{i>=1} |theta_i|, on the shared MSE core.
Examples
morie_geron_lasso_cost(X = c(1, 2, 3, 4, 5, 6, 7, 8), y = 5L,
theta = c(1, 2, 3, 4, 5, 6, 7, 8), alpha = 0.5)
#> $cost
#> [1] 39618.5
#>
#> $mse
#> [1] 39601
#>
#> $l1_penalty
#> [1] 17.5
#>
#> $l1_norm
#> [1] 35
#>
#> $n_zero
#> [1] 0
#>
#> $alpha
#> [1] 0.5
#>
#> $estimate
#> [1] 39618.5
#>
#> $n
#> [1] 1
#>