
Elastic net cost: MSE + r\*alpha\*L1 + (1-r)/2\*alpha\*L2 (hmenet)
Source:R/geron_w4a_native.R
morie_geron_elastic_net.RdElastic net cost: MSE + r\*alpha\*L1 + (1-r)/2\*alpha\*L2 (hmenet)
Examples
morie_geron_elastic_net(matrix(c(1, 2), 2, 1), c(2, 4), c(0,
2), alpha = 1, r = 0.5)
#> $cost
#> [1] 2
#>
#> $mse
#> [1] 0
#>
#> $l1_penalty
#> [1] 1
#>
#> $l2_penalty
#> [1] 1
#>
#> $penalty
#> [1] 2
#>
#> $gradient
#> [1] 0.0 1.5
#>
#> $alpha
#> [1] 1
#>
#> $r
#> [1] 0.5
#>
#> $estimate
#> [1] 2
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "elastic net J = MSE + r*alpha*L1 + (1-r)/2*alpha*L2"
#>