8000 Fix Ridge floating point instability (#8154) · scikit-learn/scikit-learn@8998856 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8998856

Browse files
lestevejnothman
authored andcommitted
Fix Ridge floating point instability (#8154)
1 parent 2f7f5a1 commit 8998856

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/linear_model/ridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ def _errors_and_values_helper(self, alpha, y, v, Q, QT_y):
885885
constant_column = np.var(Q, 0) < 1.e-12
886886
# detect constant columns
887887
w[constant_column] = 0 # cancel the regularization for the intercept
888-
w[v == 0] = 0
888+
889889
c = np.dot(Q, self._diag_dot(w, QT_y))
890890
G_diag = self._decomp_diag(w, Q)
891891
# handle case where y is 2-d

0 commit comments

Comments
 (0)
0