Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ jobs:

- name: Run sklearn integration tests for ${{ matrix.sklearn-version }}
run: |
python -m pytest -x -p no:warnings tests/integrations/sklearn/
python -m pytest -x -p no:warnings src/hyperactive/integrations/sklearn/
1 change: 1 addition & 0 deletions src/hyperactive/integrations/sklearn/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Tests for sklearn integrations."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Test module for sklearn parametrize_with_checks integration."""

from sklearn import svm
from sklearn.model_selection import KFold
from sklearn.utils.estimator_checks import parametrize_with_checks

from hyperactive.integrations import OptCV
from hyperactive.opt import GridSearchSk as GridSearch

svc = svm.SVC()
parameters = {"kernel": ["linear", "rbf"], "C": [1, 10]}

cv = KFold(n_splits=2, shuffle=True, random_state=42)
optcv = OptCV(estimator=svc, optimizer=GridSearch(param_grid=parameters), cv=cv)

ESTIMATORS = [optcv]


@parametrize_with_checks(ESTIMATORS)
def test_estimators(estimator, check):
"""Test estimators with sklearn estimator checks."""
check(estimator)
Loading