ClassificationSample

Support vector machine

Finds the boundary with the widest margin between the classes, optionally in a kernel-transformed space.

Synthetic data, generated and trained in your browser.

Try this

  1. 01On Two blobs, lower C: the margin widens and more points become support vectors.
  2. 02On Moons, switch to RBF: a curved boundary appears.
  3. 03With RBF, push γ to 300 and turn on the test split: the boundary wraps individual points (overfitting).

How it works

  1. 1Look for the boundary that separates the classes with the widest margin.
  2. 2Allow some points inside the margin, at a cost set by C (a soft margin).
  3. 3Only the points on or inside the margin, the support vectors, define the boundary.
  4. 4A kernel such as RBF measures similarity in a way that lets the boundary bend.

What the controls teach

Kernel
Linear draws a straight boundary; RBF can wrap around clusters.
C (margin softness)
Cost of margin violations. Low C gives a wide, tolerant margin; high C fits the training points tightly.
γ (RBF width)
Reach of each point in the RBF kernel. High γ makes tight, wiggly boundaries.

Use it when

  • Clear margins between classes
  • Medium-sized data with complex boundaries (RBF)

Avoid it when

  • Very large datasets
  • When probabilities are required out of the box

More in Classification