Skip to content

Commit

Permalink
Add basic common test infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim committed Oct 11, 2024
1 parent 592168e commit fde0ee8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/cuml/cuml/internals/mixins.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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,
Expand Down
26 changes: 26 additions & 0 deletions python/cuml/cuml/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit fde0ee8

Please sign in to comment.