Skip to content

Commit

Permalink
fix 2 warnings in test due to np.matrix being used (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathurinm committed Dec 10, 2021
1 parent 69f27f2 commit f7fa260
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions celer/tests/test_lasso.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def test_weights():
**params)

alphas2, coefs2, gaps2 = celer_path(
X / weights[None, :], y, "lasso", **params)
X.multiply(1 / weights[None, :]), y, "lasso", **params)

assert_allclose(alphas1, alphas2)
assert_allclose(
Expand All @@ -208,7 +208,8 @@ def test_weights():

alpha = 0.001
clf1 = Lasso(alpha=alpha, weights=weights, fit_intercept=False).fit(X, y)
clf2 = Lasso(alpha=alpha, fit_intercept=False).fit(X / weights, y)
clf2 = Lasso(alpha=alpha, fit_intercept=False).fit(
X.multiply(1. / weights), y)

assert_allclose(clf1.coef_, clf2.coef_ / weights)

Expand Down

0 comments on commit f7fa260

Please sign in to comment.