10000 Fix AttributeError in prediction. · scikit-learn/scikit-learn@a2774cb · GitHub
[go: up one dir, main page]

Skip to content

Commit a2774cb

Browse files
committed
Fix AttributeError in prediction.
1 parent 22fd57c commit a2774cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/multi_label/classifier_chain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ClassifierChain(BaseEstimator):
2525
2626
Attributes
2727
----------
28-
n_labels : int
28+
n_labels_ : int
2929
How many labels are there in this model.
3030
3131
classifiers_ : array
@@ -99,7 +99,7 @@ def predict(self, X):
9999
for clf in self.classifiers_:
100100
X = self._predict_and_chain(clf, X)
101101

102-
return X[:, -self.n_labels:]
102+
return X[:, -self.n_labels_:]
103103

104104
def _predict_and_chain(self, clf, X):
105105
return np.hstack((X, clf.predict(X).reshape(-1, 1)))

0 commit comments

Comments
 (0)
0