Why don't kernel SVMs scale well to millions of samples?
mediumAnswer
- The dual problem has memory (kernel matrix) and to training complexity.
- For n = 1M, that's a trillion entries — impossible.
- Workarounds: (1) linear SVM (LinearSVC / liblinear) which is O(nd) via primal optimization; (2) approximate kernels via random Fourier features / Nyström before feeding to a linear SVM; (3) switch entirely to gradient-boosted trees or neural nets, which routinely handle millions of samples.
Check yourself — multiple choice
- SVMs scale linearly with n
- Kernel matrix is ; at large n use LinearSVC, random features, or switch models
- SVMs are always the fastest
- Their scaling only depends on the number of features
kernel matrix + up to training ⇒ kernel SVMs don't scale to millions of rows.
#svm#optimization
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- Why do SVMs use kernels?
- What is Empirical Risk Minimization?
- Why do we care whether the loss landscape is convex?
- Why does OLS have a closed-form solution but logistic regression doesn't?
- Why do we use cross-entropy (log loss) instead of MSE for classification?
- How is logistic regression fit in practice?