Skip to content

Commit d4c7a7f

Browse files
committed
add test
1 parent b81ae90 commit d4c7a7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/fit/ols-ridge-lasso-elnet.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ end
2222
scale_penalty_with_samples = false)
2323
rr1 = RidgeRegression(λ, penalize_intercept=true,
2424
scale_penalty_with_samples = false)
25+
rr2 = RidgeRegression(λ, fit_intercept = true,
26+
penalize_intercept = false,
27+
scale_penalty_with_samples = false)
2528

2629
β_ref = (X'X + λ*I) \ (X'y)
2730
β_ref1 = (X1'X1 + λ*I) \ (X1'y1)
31+
β_ref2 = (X1'X1 + diagm(push!(fill(λ, p), 0))) \ (X1'y1)
2832
@test β_ref fit(rr, X, y)
2933
@test β_ref1 fit(rr1, X, y1)
34+
@test β_ref2 fit(rr2, X, y1)
3035

3136
β_cg = fit(rr, X, y; solver=CG())
3237
β_cg1 = fit(rr1, X, y1; solver=CG())

0 commit comments

Comments
 (0)