Back to the 2023 paper

Module 3: Classification Algorithms

20237m

State the mathematical formulation of the SVM problem. Give an outline of the method for solving the problem.

Worked SolutionAI Assisted

Mathematical Formulation of SVM Problem:

Given D={(xi,yi)},yi∈{−1,1}D=\{(x_i,y_i)\}, y_i\in\{-1,1\}, i=1..ni=1..n.

Primal (Soft-margin, most general):

min⁡w,b,ξ12∣∣w∣∣2+C∑i=1nξi\min_{w,b,\xi} \frac12||w||^2 + C\sum_{i=1}^n \xi_i
s.t. yi(wTxi+b)≥1−ξiy_i(w^T x_i + b) \ge 1-\xi_i, ξi≥0\xi_i \ge 0

Hard margin special case C→∞C\to\infty, ξi=0\xi_i=0.

Dual (Wolfe Dual, kernelizable):

Using Lagrange multipliers αi≥0\alpha_i\ge0, μi≥0\mu_i\ge0:
L=12∣∣w∣∣2+C∑ξi−∑αi[yi(wTxi+b)−1+ξi]−∑μiξiL = \frac12||w||^2 +C\sum\xi_i -\sum\alpha_i[y_i(w^T x_i+b)-1+\xi_i] -\sum\mu_i\xi_i

KKT: w=∑αiyixiw=\sum\alpha_i y_i x_i, ∑αiyi=0\sum\alpha_i y_i=0, C−αi−μi=0C-\alpha_i-\mu_i=0

Dual:
max⁡α∑iαi−12∑i,jαiαjyiyjK(xi,xj)\max_{\alpha} \sum_i \alpha_i -\frac12\sum_{i,j}\alpha_i\alpha_j y_i y_j K(x_i,x_j)
s.t. 0≤αi≤C0\le\alpha_i\le C, ∑iαiyi=0\sum_i \alpha_i y_i =0

K(xi,xj)=xiTxjK(x_i,x_j)=x_i^T x_j (linear) or kernel K=ϕ(xi)Tϕ(xj)K=\phi(x_i)^T\phi(x_j).

Decision: f(x)=sign(∑i:αi>0αiyiK(xi,x)+b)f(x)=sign(\sum_{i:\alpha_i>0}\alpha_i y_i K(x_i,x)+b), bb from support vectors where 0<αi<C0<\alpha_i<C via ys(∑αiyiK(xi,xs)+b)=1y_s(\sum\alpha_i y_i K(x_i,x_s)+b)=1.

Outline of Method for Solving:

  1. Choose CC (and kernel hyperparameters γ\gamma via CV).
  2. Solve Quadratic Programming dual for α\alpha ( convex QP). Use algorithms: SMO (Sequential Minimal Optimization) — iteratively optimizes pair of α\alpha analytically, efficient O(n)O(n); or interior point, gradient ascent.
  3. Identify Support Vectors αi>0\alpha_i>0 (approx 10−510^{-5}). SVs on margin 0<αi<C0<\alpha_i<C, inside/errors αi=C\alpha_i=C.
  4. Compute ww (implicitly via kernel) and bb averaging over margin SVs.
  5. Classify new xx via sign of kernel expansion.

For large data, use LIBSVM / LIBLINEAR, Pegasos (primal SGD).

Properties: Convex, global optimum, sparsity (only SVs matter), max margin minimizes VC bound, good generalization.

Similar questions

Student FinanceWeb Platform

Pocketly — Personal Finance for Students

Keep your hostel and college expenses under control. Track accounts, log spending in seconds, and stay within your monthly budget.