Skip to content

Commit

Permalink
Fix Ridge floating point instability (scikit-learn#8154)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesteve authored and jnothman committed Jan 7, 2017
1 parent 2f7f5a1 commit 8998856
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sklearn/linear_model/ridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def _errors_and_values_helper(self, alpha, y, v, Q, QT_y):
constant_column = np.var(Q, 0) < 1.e-12
# detect constant columns
w[constant_column] = 0 # cancel the regularization for the intercept
w[v == 0] = 0

c = np.dot(Q, self._diag_dot(w, QT_y))
G_diag = self._decomp_diag(w, Q)
# handle case where y is 2-d
Expand Down

0 comments on commit 8998856

Please sign in to comment.