From fde0ee8244323d3d9be9d7718623cefcd0801417 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Fri, 11 Oct 2024 12:56:02 +0000 Subject: [PATCH] Add basic common test infrastructure --- python/cuml/cuml/internals/mixins.py | 3 ++- python/cuml/cuml/tests/test_common.py | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 python/cuml/cuml/tests/test_common.py diff --git a/python/cuml/cuml/internals/mixins.py b/python/cuml/cuml/internals/mixins.py index c47dc56754..3618efa1a2 100644 --- a/python/cuml/cuml/internals/mixins.py +++ b/python/cuml/cuml/internals/mixins.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -37,6 +37,7 @@ "X_types_gpu": ["2darray"], # Scikit-learn API standard tags "allow_nan": False, + "array_api_support": False, "binary_only": False, "multilabel": False, "multioutput": False, diff --git a/python/cuml/cuml/tests/test_common.py b/python/cuml/cuml/tests/test_common.py new file mode 100644 index 0000000000..09da1f5216 --- /dev/null +++ b/python/cuml/cuml/tests/test_common.py @@ -0,0 +1,26 @@ +# Copyright (c) 2021-2024, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +from sklearn.utils import estimator_checks + +from cuml import LogisticRegression + + +@estimator_checks.parametrize_with_checks([LogisticRegression()]) +def test_sklearn_compatible_estimator(estimator, check): + # Check that all estimators pass the "common estimator" checks + # provided by scikit-learn + check(estimator)