One-vs-one multiclass strategy
This strategy consists in fitting one classifier per class pair. At prediction time, the class which received the most votes is selected. Since it requires to fit `n_classes * (n_classes - 1) / 2` classifiers, this method is usually slower than one-vs-the-rest, due to its O(n_classes^2) complexity. However, this method may be advantageous for algorithms such as kernel algorithms which don't scale well with `n_samples`. This is because each individual learning problem only involves a small subset of the data whereas, with one-vs-the-rest, the complete dataset is used `n_classes` times.
Read more in the :ref:`User Guide <ovo_classification>`.
Parameters ---------- estimator : estimator object An estimator object implementing :term:`fit` and one of :term:`decision_function` or :term:`predict_proba`.
n_jobs : int or None, optional (default=None) The number of jobs to use for the computation. ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context. ``-1`` means using all processors. See :term:`Glossary <n_jobs>` for more details.
Attributes ---------- estimators_ : list of ``n_classes * (n_classes - 1) / 2`` estimators Estimators used for predictions.
classes_ : numpy array of shape n_classes
Array containing labels.
n_classes_ : int Number of classes
pairwise_indices_ : list, length = ``len(estimators_)``, or ``None`` Indices of samples used when training the estimators. ``None`` when ``estimator`` does not have ``_pairwise`` attribute.