Skip to content

Commit

Permalink
Remove normalize argument when creating sklearn solvers (#333)
Browse files Browse the repository at this point in the history
The normalize argument in the sklearn.LinearRegression and sklearn.Ridge
classes has been deprecated since sklearn 1.0. The previous default was 
False anyway so we can safely remove the argument here.
  • Loading branch information
santisoler authored Dec 10, 2021
1 parent eb636e3 commit f0b2021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions verde/base/least_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def least_squares(jacobian, data, weights, damping=None, copy_jacobian=False):
scaler = StandardScaler(copy=copy_jacobian, with_mean=False, with_std=True)
jacobian = scaler.fit_transform(jacobian)
if damping is None:
regr = LinearRegression(fit_intercept=False, normalize=False)
regr = LinearRegression(fit_intercept=False)
else:
regr = Ridge(alpha=damping, fit_intercept=False, normalize=False)
regr = Ridge(alpha=damping, fit_intercept=False)
regr.fit(jacobian, data.ravel(), sample_weight=weights)
params = regr.coef_ / scaler.scale_
return params

0 comments on commit f0b2021

Please sign in to comment.