We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b81ae90 commit d4c7a7fCopy full SHA for d4c7a7f
test/fit/ols-ridge-lasso-elnet.jl
@@ -22,11 +22,16 @@ end
22
scale_penalty_with_samples = false)
23
rr1 = RidgeRegression(λ, penalize_intercept=true,
24
25
+ rr2 = RidgeRegression(λ, fit_intercept = true,
26
+ penalize_intercept = false,
27
+ scale_penalty_with_samples = false)
28
29
β_ref = (X'X + λ*I) \ (X'y)
30
β_ref1 = (X1'X1 + λ*I) \ (X1'y1)
31
+ β_ref2 = (X1'X1 + diagm(push!(fill(λ, p), 0))) \ (X1'y1)
32
@test β_ref ≈ fit(rr, X, y)
33
@test β_ref1 ≈ fit(rr1, X, y1)
34
+ @test β_ref2 ≈ fit(rr2, X, y1)
35
36
β_cg = fit(rr, X, y; solver=CG())
37
β_cg1 = fit(rr1, X, y1; solver=CG())
0 commit comments