diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 46aa4f2..f1da1f2 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, '3.10'] + python-version: [3.8, '3.11'] steps: - uses: actions/checkout@v2 diff --git a/hulearn/__init__.py b/hulearn/__init__.py index 334b899..a8d4557 100644 --- a/hulearn/__init__.py +++ b/hulearn/__init__.py @@ -1 +1 @@ -__version__ = "0.3.4" +__version__ = "0.3.5" diff --git a/hulearn/classification/functionclassifier.py b/hulearn/classification/functionclassifier.py index 7f64fb0..7929ff0 100644 --- a/hulearn/classification/functionclassifier.py +++ b/hulearn/classification/functionclassifier.py @@ -1,5 +1,6 @@ from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_is_fitted +from sklearn.utils.multiclass import unique_labels class FunctionClassifier(BaseEstimator, ClassifierMixin): @@ -46,6 +47,7 @@ def fit(self, X, y): """ # Run it to confirm no error happened. _ = self.func(X, **self.kwargs) + self.classes_ = unique_labels(y) self.fitted_ = True return self @@ -55,6 +57,7 @@ def partial_fit(self, X, y, classes=None, sample_weight=None): """ # Run it to confirm no error happened. _ = self.func(X, **self.kwargs) + self.classes_ = classes self.fitted_ = True return self diff --git a/setup.py b/setup.py index fdfbd9a..5a17987 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,7 @@ def read(fname): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence",