From 6561ccabcfb9b9142d91e86b6ad761d2c6e7dfdc Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Wed, 28 Jan 2026 14:40:24 -0600 Subject: [PATCH 1/2] Ignore warnings caused by sklearn/scipy incompatibility. Closes https://github.com/rapidsai/cuml/issues/7733 --- python/cuml/tests/test_linear_model.py | 15 +++++++++++++++ python/cuml/tests/test_sklearn_import_export.py | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/python/cuml/tests/test_linear_model.py b/python/cuml/tests/test_linear_model.py index 77c06cd9fc..f2fb1816da 100644 --- a/python/cuml/tests/test_linear_model.py +++ b/python/cuml/tests/test_linear_model.py @@ -359,6 +359,11 @@ def test_logistic_regression_unscaled(dtype, l1_ratio, C): assert score_test >= 0.94 +# Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression +# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +@pytest.mark.filterwarnings( + "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" +) @given(dtype=dataset_dtypes()) @example(dtype=np.float32) @example(dtype=np.float64) @@ -570,6 +575,11 @@ def test_logistic_regression_input_type_consistency(constructor, dtype): assert isinstance(clf.predict(X), expected_type) +# Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression +# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +@pytest.mark.filterwarnings( + "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" +) @pytest.mark.parametrize( "y_kind", ["object", "fixed-string", "int32", "float32", "float16"] ) @@ -759,6 +769,11 @@ def test_logistic_predict_convert_dtype(dataset, test_dtype): use_sample_weight=False, class_weight_option=None, ) +# Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression +# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +@pytest.mark.filterwarnings( + "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" +) def test_logistic_regression_weighting( dataset, use_sample_weight, class_weight_option ): diff --git a/python/cuml/tests/test_sklearn_import_export.py b/python/cuml/tests/test_sklearn_import_export.py index df22e72310..e7f35282fe 100644 --- a/python/cuml/tests/test_sklearn_import_export.py +++ b/python/cuml/tests/test_sklearn_import_export.py @@ -213,6 +213,11 @@ def test_linear_regression(random_state): assert_estimator_roundtrip(original, SkLinearRegression, X, y) +# Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression +# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +@pytest.mark.filterwarnings( + "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" +) def test_logistic_regression(random_state): X, y = make_classification( n_samples=50, n_features=5, n_informative=3, random_state=random_state From afc849b39a1918d370d1a09a82ecb8ca027deaf1 Mon Sep 17 00:00:00 2001 From: Simon Adorf Date: Wed, 28 Jan 2026 16:04:37 -0600 Subject: [PATCH 2/2] Fix comments. --- python/cuml/tests/test_linear_model.py | 6 +++--- python/cuml/tests/test_sklearn_import_export.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/cuml/tests/test_linear_model.py b/python/cuml/tests/test_linear_model.py index f2fb1816da..551ac764f3 100644 --- a/python/cuml/tests/test_linear_model.py +++ b/python/cuml/tests/test_linear_model.py @@ -360,7 +360,7 @@ def test_logistic_regression_unscaled(dtype, l1_ratio, C): # Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression -# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +# using deprecated L-BFGS-B parameters. This is fixed in sklearn 1.6.0+. @pytest.mark.filterwarnings( "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" ) @@ -576,7 +576,7 @@ def test_logistic_regression_input_type_consistency(constructor, dtype): # Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression -# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +# using deprecated L-BFGS-B parameters. This is fixed in sklearn 1.6.0+. @pytest.mark.filterwarnings( "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" ) @@ -770,7 +770,7 @@ def test_logistic_predict_convert_dtype(dataset, test_dtype): class_weight_option=None, ) # Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression -# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +# using deprecated L-BFGS-B parameters. This is fixed in sklearn 1.6.0+. @pytest.mark.filterwarnings( "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" ) diff --git a/python/cuml/tests/test_sklearn_import_export.py b/python/cuml/tests/test_sklearn_import_export.py index e7f35282fe..36428e17ec 100644 --- a/python/cuml/tests/test_sklearn_import_export.py +++ b/python/cuml/tests/test_sklearn_import_export.py @@ -214,7 +214,7 @@ def test_linear_regression(random_state): # Ignore scipy 1.17.0+ deprecation warning from sklearn 1.5.x LogisticRegression -# using deprecated L-BFGS-B parameters. Will be fixed in sklearn 1.6.0+ +# using deprecated L-BFGS-B parameters. This is fixed in sklearn 1.6.0+. @pytest.mark.filterwarnings( "ignore:.*The `disp` and `iprint` options.*:DeprecationWarning" )