Back to the 2022 paper

Module 3: Classification Algorithms

202214m

Explain how the linear maximum-margin classifier can be modified to be non-linear and to allow misclassification of the training examples. Give a derivation of the modified optimization problem needed for training. You need only derive a statement of the primal optimization problem.

Worked SolutionAI Assisted

Linear Maximum-Margin Classifier (Hard SVM):

Primal: min⁡w,b12∣∣w∣∣2\min_{w,b} \frac12||w||^2 s.t. yi(wTxi+b)≥1y_i(w^T x_i + b) \ge 1, yi∈{−1,1}y_i\in\{-1,1\}

Margin =2/∣∣w∣∣=2/||w||, support vectors satisfy equality. Only linear separable case, no slack.

Modifications for Non-linear and Non-separable:

  1. Allow misclassification (Soft Margin): Introduce slack ξi≥0\xi_i \ge 0:
    yi(wTxi+b)≥1−ξiy_i(w^T x_i+b) \ge 1-\xi_i. ξi>0\xi_i>0 violates margin, ξi>1\xi_i>1 misclassifies. Add penalty C∑ξiC\sum\xi_i.

  2. Make Non-linear via Feature Map ϕ(x)\phi(x) and Kernel: Map x→ϕ(x)x\to\phi(x) to higher dimension where linear separation possible. Replace wTxw^T x with wTϕ(x)w^T\phi(x). Kernel trick: K(xi,xj)=ϕ(xi)Tϕ(xj)K(x_i,x_j)=\phi(x_i)^T\phi(x_j) avoids explicit high-dim computation (Polynomial, RBF).

Derivation — Primal for Soft-Margin Non-linear SVM:

Minimize over w,b,ξw,b,\xi:
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(wTϕ(xi)+b)≥1−ξiy_i(w^T\phi(x_i)+b) \ge 1-\xi_i, ξi≥0\xi_i \ge 0, i=1..ni=1..n

  • First term maximizes margin (1/∣∣w∣∣1/||w||).
  • Second penalizes violations; CC trades margin width vs training error (small CC wider margin more violations, large CC hard margin approx).
  • ξi=max⁡(0,1−yi(wTϕ(xi)+b))\xi_i = \max(0, 1-y_i(w^T\phi(x_i)+b)) = hinge loss.

If separable, optimum ξi=0\xi_i=0 recovers hard margin. Non-linear version retains same form with ϕ\phi. Dual leads to w=∑αiyiϕ(xi)w=\sum\alpha_i y_i\phi(x_i) and kernelized decision f(x)=∑αiyiK(xi,x)+ ⁣bf(x)=\sum\alpha_i y_i K(x_i,x)+\!b.

Without slack & kernel, linear separable only; with them, general-purpose classifier.

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.