DalšíDalší průvodce
gRPC vs REST pro obsluhu modelů
Technický
Technický PRŮVODCE
One-vs-rest (OvR) and one-vs-one (OvO) are two ways to adapt a binary classifier, which only distinguishes between two classes, into one that handles many classes.
Poslechněte si tento návodAI-vyprávěný · ~3 min
OvR trains one classifier per class against all others, while OvO trains one classifier for every pair of classes and combines their votes. They matter because many powerful algorithms, such as basic support vector machines, are natively binary, so these strategies extend them to real-world problems with more than two categories.
One-vs-rest (OvR, also called one-vs-all) and one-vs-one (OvO) are the two standard ways to extend binary classifiers to multiclass problems. Given K classes, OvR trains K separate binary classifiers: each learns to separate a single class from all the others combined. At prediction time, all K classifiers score the input, and the class whose classifier gives the highest confidence wins. OvO instead trains a classifier for every pair of classes, giving K(K-1)/2 classifiers total. Each pairwise classifier only sees examples from its two classes during training, so its decision boundary can be simpler and its training set smaller. At prediction time, every pairwise classifier votes for one of its two classes, and the class with the most votes is chosen, with ties broken by summed confidence scores. The tradeoffs are the main reason the choice matters. OvR trains fewer classifiers but each is trained on an imbalanced dataset (one class vs. everyone else), which can hurt performance when classes are unevenly sized. OvO trains many more classifiers for large K, but each pairwise classifier sees only two classes, so its training set is often smaller (though class counts within a pair can still differ), which is why OvO is the traditional default for kernel support vector machines, where training time scales poorly with dataset size. A common misconception is that one strategy is universally better; in practice the choice depends on the algorithm's cost function and dataset size, and libraries pick sensible defaults per algorithm.
Handwritten digit recognition (0-9): OvR trains 10 classifiers, each separating one digit from all others, and picks the classifier with the highest confidence score.
Support vector machines for a 5-class image-tagging task: OvO trains 10 pairwise classifiers (5 choose 2) and each votes for one of its two classes, with the majority deciding the label.
Text categorization across many topics (sports, politics, tech): OvR is often preferred here because training one classifier per topic scales linearly rather than quadratically with the number of topics.
A logistic regression library defaulting to OvR for multiclass problems when its solver only supports two-class boundaries, silently running multiple fits behind a single API call.
OvR and OvO remain relevant mainly for classifiers that are inherently binary, such as standard support vector machines. Many estimators handle multiclass targets natively, while some binary learners still use wrappers or their own decompositions and do not need these wrapper strategies, so their practical use has narrowed to specific algorithm families and libraries offering a uniform multiclass interface. Neither method is likely to change further because the ideas are simple and complete for the closed problem of pairwise or single-vs-all decomposition. Any future relevance would come from new binary-only architectures needing multiclass wrappers.
Newsletter zdarma
Tři ověřené příběhy ze světa AI každý všední den ráno, psané srozumitelnou angličtinou. Navždy zdarma, bez reklam.
Jeden e-mail každý všední den. Odhlásit se můžete jedním kliknutím. Vaši adresu nikdy neprodáváme ani nesdílíme.
Otestujte se
Okamžitá zpětná vazba ke každé odpovědi a sdílitelný certifikát s ověřitelným ID po absolvování kurzu.
Podpořte bezplatnou AI vzdělávání. AI Understanding je nezisková organizace 501(c)(3) — žádné reklamy, žádná platba za přístup, nikdy. Darujte
One-vs-rest (OvR) and one-vs-one (OvO) are two ways to adapt a binary classifier, which only distinguishes between two classes, into one that handles many classes. OvR trains one classifier per class against all others, while OvO trains one classifier for every pair of classes and combines their votes. They matter because many powerful algorithms, such as basic support vector machines, are natively binary, so these strategies extend them to real-world problems with more than two categories.
OvR trénuje jeden klasifikátor na třídu, takže s třídami K=6 trénuje přesně 6 klasifikátorů, z nichž každý odděluje jednu třídu od ostatních.
OvO trénuje jeden klasifikátor na pár tříd, což je K(K-1)/2; pro 6 tříd, což je 6x5/2 = 15.
OvR porovnává skóre spolehlivosti/rozhodnutí ze všech K klasifikátorů a vybírá třídu, jejíž klasifikátor dosáhl nejvyššího skóre.
Každý párový klasifikátor OvO hlasuje pro jednu ze dvou tříd, na kterých byl trénován; třída, která obdrží nejvíce hlasů ze všech párů, je předpověď.
Náklady na školení SVM jádra se špatně škálují s velikostí datové sady, takže menší sady školení OvO na klasifikátor mohou urychlit celkové školení, přestože potřebují klasifikátory K(K-1)/2.
Učte se dál
Pro toto téma bylo vybráno více průvodců
DalšíDalší průvodce
gRPC vs REST pro obsluhu modelů
Technický