sklearn.multiclass#

Multiclass learning algorithms.

  • one-vs-the-rest / one-vs-all

  • one-vs-one

  • error correcting output codes

The estimators provided in this module are meta-estimators: they require a baseestimator to be provided in their constructor. For example, it is possible touse these estimators to turn a binary classifier or a regressor into amulticlass classifier. It is also possible to use these estimators withmulticlass estimators in the hope that their accuracy or runtime performanceimproves.

All classifiers in scikit-learn implement multiclass classification; youonly need to use this module if you want to experiment with custom multiclassstrategies.

The one-vs-the-rest meta-classifier also implements apredict_proba method,so long as such a method is implemented by the base classifier. This methodreturns probabilities of class membership in both the single label andmultilabel case. Note that in the multilabel case, probabilities are themarginal probability that a given sample falls in the given class. As such, inthe multilabel case the sum of these probabilities over all possible labelsfor a given samplewill not sum to unity, as they do in the single labelcase.

User guide. See theMulticlass classification section for further details.

OneVsOneClassifier

One-vs-one multiclass strategy.

OneVsRestClassifier

One-vs-the-rest (OvR) multiclass strategy.

OutputCodeClassifier

(Error-Correcting) Output-Code multiclass strategy.