Implement SMO for the SVM dual
CodingGraduate⏱ 1 dayClassical MLsvmsmoimplementationkktquadratic programming
Problem
Implement sequential minimal optimisation for the soft-margin dual and verify it against a general-purpose QP solver.
- Derive the closed-form solution of the two-variable subproblem with clipping.
- Implement the working-set selection by maximal KKT violation.
- Verify the support-vector classification (the three KKT regimes) on a synthetic problem.
- Compare the decision boundary with a kernel of your choice against a linear one.
Implement it, then check the implementation against something you can verify independently.
Write it
Solve it here8 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 90s · draft saved in this browser
8 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.
Solution
Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.
Related problems
All problems| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| The geometric margin | Classical ML | Proof | 15 min | ||
| Solve a two-point SVM by hand | Classical ML | Numerical | 30 min | ||
| Complementary slackness and active constraints | Advanced Optimization | Proof | 30 min | ||
| Implement backpropagation from scratch run | Deep Learning | Coding | 3 hours | ||
| Implement kernel ridge regression run | Classical ML | Coding | 1 hour |