Skip to content

Commit

Permalink
add self.classes_
Browse files Browse the repository at this point in the history
  • Loading branch information
koaning committed Jan 2, 2024
1 parent 6c7501a commit 5506794
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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"
4 changes: 3 additions & 1 deletion hulearn/classification/functionclassifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +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 +46,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 +56,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 5506794

Please sign in to comment.