Skip to content

TST reduce warnings in test_logistic.py #25469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sklearn/linear_model/tests/test_logistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,13 +1380,13 @@ def test_elastic_net_coeffs():
C = 2.0
l1_ratio = 0.5
coeffs = list()
for penalty in ("elasticnet", "l1", "l2"):
for penalty, ratio in (("elasticnet", l1_ratio), ("l1", None), ("l2", None)):
lr = LogisticRegression(
penalty=penalty,
C=C,
solver="saga",
random_state=0,
l1_ratio=l1_ratio,
l1_ratio=ratio,
tol=1e-3,
max_iter=200,
)
Expand Down Expand Up @@ -1807,7 +1807,7 @@ def test_penalty_none(solver):
# non-default value.
# - Make sure setting penalty=None is equivalent to setting C=np.inf with
# l2 penalty.
X, y = make_classification(n_samples=1000, random_state=0)
X, y = make_classification(n_samples=1000, n_redundant=0, random_state=0)

msg = "Setting penalty=None will ignore the C"
lr = LogisticRegression(penalty=None, solver=solver, C=4)
Expand Down