Skip to content

Commit ea2f70d

Browse files
Add attribute to method in BCNClassifier
1 parent 84352a1 commit ea2f70d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

BCN/BCNClassifier.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def fit(self, X, y, **kwargs):
140140
Target values.
141141
142142
"""
143-
143+
self.classes_ = np.unique(y)
144+
self.n_classes_ = len(self.classes_)
144145
# cf. https://rpy2.github.io/doc/latest/html/numpy.html
145146
# Create a converter that starts with rpy2's default converter
146147
# to which the numpy conversion rules are added.
@@ -165,7 +166,7 @@ def fit(self, X, y, **kwargs):
165166
verbose = self.verbose,
166167
show_progress = self.show_progress,
167168
seed = self.seed
168-
)
169+
)
169170
return self
170171

171172
def predict_proba(self, X):

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
History
33
=======
44

5+
0.7.1 (2024-02-06)
6+
------------------
7+
8+
* Add `classes_` attribute to `fit` method in BCNClassifier
9+
510
0.6.2 (2024-01-25)
611
------------------
712

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,6 @@ def install_r():
132132
test_suite='tests',
133133
tests_require=test_requirements,
134134
url='https://github.com/Techtonique/bcn_python',
135-
version='0.7.0',
135+
version='0.7.1',
136136
zip_safe=False,
137137
)

0 commit comments

Comments
 (0)