Skip to content

Commit b81ae90

Browse files
committed
fix
1 parent 61ed71f commit b81ae90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function form_XtX(X, fit_intercept, lambda = 0, penalize_intercept = true)
116116
end
117117
if !iszero(lambda)
118118
λ = convert(eltype(XtX), lambda)
119-
@inbounds for i in 1:size(XtX, 1) - 1 + penalize_intercept
119+
@inbounds for i in 1:size(XtX, 1) + fit_intercept * (penalize_intercept - 1)
120120
XtX[i,i] += λ
121121
end
122122
end

0 commit comments

Comments
 (0)