MNT Minor clean up in OneVsOneClassifier
@@ -465,11 +465,15 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin):
Attributes
----------
- estimators_ : list of `n_classes * (n_classes - 1) / 2` estimators
+ estimators_ : list of ``n_classes * (n_classes - 1) / 2`` estimators
Estimators used for predictions.
classes_ : numpy array of shape [n_classes]
Array containing labels.
+
+ pairwise_indices_ : list, length = ``len(estimators_)``, or ``None``
+ Indices of samples used when training the estimators.
+ ``None`` when ``estimator`` does not have ``_pairwise`` attribute.
"""
def __init__(self, estimator, n_jobs=None):
@@ -505,11 +509,8 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin):
for i in range(n_classes) for j in range(i + 1, n_classes)))))
self.estimators_ = estimators_indices[0]
- try:
self.pairwise_indices_ = (
estimators_indices[1] if self._pairwise else None)
- except AttributeError:
- self.pairwise_indices_ = None
return self
@@ -630,10 +631,6 @@ class OneVsOneClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin):
"""Indicate if wrapped estimator is using a precomputed Gram matrix"""
return getattr(self.estimator, "_pairwise", False)
- def _more_tags(self):
- # FIXME Remove once #10440 is merged
- return {'_skip_test': True}
-
class OutputCodeClassifier(BaseEstimator, ClassifierMixin, MetaEstimatorMixin):
"""(Error-Correcting) Output-Code multiclass strategy
