Skip to content

Commit 5171932

Browse files
committed
Recommit extended test (with warnings supressed)
1 parent 8bf6966 commit 5171932

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

sklearn/linear_model/tests/test_coordinate_descent.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,17 @@ def test_enet_l1_ratio():
730730
MultiTaskElasticNetCV(l1_ratio=0).fit, X, X)
731731

732732
# Test that l1_ratio=0 is allowed if we supply a grid manually
733-
# alphas = [0.1, 10]
734-
# est_desired = ElasticNetCV(l1_ratio=0.00001, alphas=alphas)
735-
# est = ElasticNetCV(l1_ratio=0, alphas=alphas)
736-
# est_desired.fit(X, y)
737-
# est.fit(X, y)
738-
# assert_almost_equal(est.coef_, est_desired.coef_, decimal=5)
739-
#
740-
# est_desired = MultiTaskElasticNetCV(l1_ratio=0.00001, alphas=alphas)
741-
# est = MultiTaskElasticNetCV(l1_ratio=0, alphas=alphas)
742-
# est.fit(X, X)
743-
# est_desired.fit(X, X)
744-
# assert_almost_equal(est.coef_, est_desired.coef_, decimal=5)
733+
alphas = [0.1, 10]
734+
est_desired = ElasticNetCV(l1_ratio=0.00001, alphas=alphas)
735+
est = ElasticNetCV(l1_ratio=0, alphas=alphas)
736+
with ignore_warnings():
737+
est_desired.fit(X, y)
738+
est.fit(X, y)
739+
assert_almost_equal(est.coef_, est_desired.coef_, decimal=5)
740+
741+
est_desired = MultiTaskElasticNetCV(l1_ratio=0.00001, alphas=alphas)
742+
est = MultiTaskElasticNetCV(l1_ratio=0, alphas=alphas)
743+
with ignore_warnings():
744+
est.fit(X, X)
745+
est_desired.fit(X, X)
746+
assert_almost_equal(est.coef_, est_desired.coef_, decimal=5)

0 commit comments

Comments
 (0)