Multiclass classification refers to those classification tasks that have more than two targets.
OneVsRestClassifier (OvR):
OneVsOneClassifier (OvO):
OutputCodeClassifier:
Some estimators handle multiclass natively (no wrapper needed):
LogisticRegression (using 'multinomial' loss).RandomForestClassifier.GaussianNB.LinearDiscriminantAnalysis.from sklearn.multiclass import OneVsRestClassifier, OneVsOneClassifier
from sklearn.svm import SVC
from sklearn.datasets import load_iris
X, y = load_iris(return_X_y=True)
# 1. One-vs-Rest
ovr = OneVsRestClassifier(SVC(kernel='linear'))
ovr.fit(X, y)
# 2. One-vs-One
ovo = OneVsOneClassifier(SVC(kernel='linear'))
ovo.fit(X, y)
Credits: This cheatsheet is based on the scikit-learn documentation and examples, which are licensed under the BSD 3-Clause License. Copyright (c) 2007 - 2026 The scikit-learn developers. All rights reserved.