-
Notifications
You must be signed in to change notification settings - Fork 623
Reduce warnings verbosity in tests #7322
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
Changes from 7 commits
6f41387
aa2f649
f8314b0
4ec2061
4f84c48
058e299
99abfdd
d854ffe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1129,6 +1129,7 @@ def test_elasticnet_solvers_eq(datatype, alpha, l1_ratio, nrows, column_info): | |
| assert np.corrcoef(cd.coef_, qn.coef_)[0, 1] > 0.98 | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore:Changing solver.*:UserWarning") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I renamed and rewrote this test in #7355, and am a bit surprised not to see a merge conflict here. 🤷 what the merged version will look like or if this decorator is still needed here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked locally and it looks like it's applying it correctly: diff --git a/python/cuml/tests/test_linear_model.py b/python/cuml/tests/test_linear_model.py
index 6eb48d45a..b7d5e76ee 100644
--- a/python/cuml/tests/test_linear_model.py
+++ b/python/cuml/tests/test_linear_model.py
@@ -1115,30 +1115,31 @@ def test_elasticnet_solvers_eq(datatype, alpha, l1_ratio, nrows, column_info):
)
kwargs = {"alpha": alpha, "l1_ratio": l1_ratio}
cd = cuElasticNet(solver="cd", **kwargs)
cd.fit(X_train, y_train)
cd_res = cd.predict(X_test)
qn = cuElasticNet(solver="qn", **kwargs)
qn.fit(X_train, y_train)
# the results of the two models should be close (even if both are bad)
assert qn.score(X_test, cd_res) > 0.90
# coefficients of the two models should be close
assert np.corrcoef(cd.coef_, qn.coef_)[0, 1] > 0.98
+@pytest.mark.filterwarnings("ignore:Changing solver.*:UserWarning")
@given(
algo=st.sampled_from(["eig", "qr", "svd", "svd-qr"]),
n_targets=st.integers(min_value=1, max_value=2),
fit_intercept=st.booleans(),
weighted=st.booleans(),
)
@example(algo="eig", n_targets=1, fit_intercept=True, weighted=False)
@example(algo="qr", n_targets=1, fit_intercept=True, weighted=False)
@example(algo="svd-qr", n_targets=1, fit_intercept=True, weighted=False)
@example(algo="svd", n_targets=1, fit_intercept=True, weighted=False)
@example(algo="svd", n_targets=2, fit_intercept=False, weighted=True)
def test_linear_regression_input_mutation(
algo, n_targets, fit_intercept, weighted
):
"""Check that `LinearRegression.fit`: |
||
| @given( | ||
| algorithm=st.sampled_from(ALGORITHMS), | ||
| xp=st.sampled_from([np, cp]), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.