Classification · Intermediate

Support Vector Machine

Inspect decision scores, margins, hinge loss, kernels, and active support influence.

SVM learns a margin-based decision function. ModelOrigen records real optimizer checkpoints and exposes decision scores, hinge loss, objective, margin evidence, kernel behavior, and active coefficients.

Step by step

  1. Encode the two classes with opposite signs.
  2. Choose a kernel and C penalty.
  3. Optimize coefficients and bias under the margin objective.
  4. Identify samples with non-zero support influence.
  5. Calculate the query decision score.
  6. Use the score sign for the final class and inspect the margin/boundary.

Core formulas

Decision function

f(x) = Σ αᵢ yᵢ K(xᵢ,x) + b

Support coefficients and the kernel define the score.

Hinge loss

max(0, 1 − y·f(x))

Penalizes samples that violate the desired margin.

Soft-margin objective

½||w||² + C Σ hingeᵢ

C balances a wider margin against violations for the linear intuition.

When to use Support Vector Machine

  • Margin separation is useful and data size is manageable.
  • High-dimensional features may be effective.
  • A kernelized nonlinear boundary is worth the extra complexity.

Related interactive lessons

Primary references

scikit-learn SVM guide