Skip to content

Commit

Permalink
add self.classes_ (#83)
Browse files Browse the repository at this point in the history
* add self.classes_

* only test earliest and latest version

* black
  • Loading branch information
koaning authored Jan 2, 2024
1 parent 6c7501a commit e83ea4d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hulearn/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.4"
__version__ = "0.3.5"
3 changes: 3 additions & 0 deletions hulearn/classification/functionclassifier.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e83ea4d

Please sign in to comment.