Skip to content

Commit f7fa260

Browse files
authored
fix 2 warnings in test due to np.matrix being used (#214)
1 parent 69f27f2 commit f7fa260

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

celer/tests/test_lasso.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_weights():
198198
**params)
199199

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

203203
assert_allclose(alphas1, alphas2)
204204
assert_allclose(
@@ -208,7 +208,8 @@ def test_weights():
208208

209209
alpha = 0.001
210210
clf1 = Lasso(alpha=alpha, weights=weights, fit_intercept=False).fit(X, y)
211-
clf2 = Lasso(alpha=alpha, fit_intercept=False).fit(X / weights, y)
211+
clf2 = Lasso(alpha=alpha, fit_intercept=False).fit(
212+
X.multiply(1. / weights), y)
212213

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

0 commit comments

Comments
 (0)