Why do kernel SVMs use one-vs-one for multi-class while linear SVMs use one-vs-rest?

Quick Overview

Asks why kernel SVMs usually train one-vs-one classifiers for multi-class problems while linear SVMs train one-vs-rest. Tests reasoning about how training and prediction cost scale with sample count and number of classes, shared support vectors, and how scikit-learn's SVC and LinearSVC behave.

Why do kernel SVMs use one-vs-one for multi-class while linear SVMs use one-vs-rest?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: hard

Interview Round: Other

Why do kernel SVM implementations typically use one-vs-one for multi-class problems while linear SVM implementations use one-vs-rest? Explain the reasoning for a problem with K classes and n training samples. ```hint Write down the cost Suppose training one SVM on m samples costs about $m^\alpha$. Compare the total work of both strategies when the n samples are split evenly across K classes, for different values of $\alpha$. ``` ```hint Do not forget prediction Count the work needed to score one test point under each strategy, separately for kernel and linear models. Ask what the pairwise kernel models can share. ``` ### What a Strong Answer Covers - How training cost grows with the number of samples for kernel and for linear SVM solvers - A comparison of the total training work of one-vs-one and one-vs-rest under each kind of scaling - The prediction cost of each strategy, and what kernel models share across pairwise classifiers - Secondary factors such as class balance and the kernel cache - How the defaults appear in a real library such as scikit-learn ### Follow-up Questions - How does one-vs-one turn pairwise decisions into a single class, and how are ties broken? - When would you use the Crammer-Singer joint multi-class formulation instead of one-vs-rest? - How would you get class probabilities from a multi-class SVM? - At what number of classes does one-vs-one become impractical even for kernel SVMs?

Overview: Asks why kernel SVMs usually train one-vs-one classifiers for multi-class problems while linear SVMs train one-vs-rest. Tests reasoning about how training and prediction cost scale with sample count and number of classes, shared support vectors, and how scikit-learn's SVC and LinearSVC behave.

PracHub logo
General
Nov 24, 2026
hardMachine Learning EngineerOtherMachine Learning
0
0

Why do kernel SVM implementations typically use one-vs-one for multi-class problems while linear SVM implementations use one-vs-rest? Explain the reasoning for a problem with K classes and n training samples.

What a Strong Answer Covers Guidance

  • How training cost grows with the number of samples for kernel and for linear SVM solvers
  • A comparison of the total training work of one-vs-one and one-vs-rest under each kind of scaling
  • The prediction cost of each strategy, and what kernel models share across pairwise classifiers
  • Secondary factors such as class balance and the kernel cache
  • How the defaults appear in a real library such as scikit-learn

Follow-up Questions Guidance

  • How does one-vs-one turn pairwise decisions into a single class, and how are ties broken?
  • When would you use the Crammer-Singer joint multi-class formulation instead of one-vs-rest?
  • How would you get class probabilities from a multi-class SVM?
  • At what number of classes does one-vs-one become impractical even for kernel SVMs?