Kernels Create Curved Boundaries
Compare similarity in a richer space
A linear SVM cannot separate concentric rings with one straight boundary. A kernel computes similarity as if points had been mapped into a richer feature space, without always constructing every added coordinate explicitly. This kernel trick lets a linear boundary in that richer space appear curved in the original one.
The radial basis function (RBF) kernel creates flexible local influence. Its gamma setting controls how far each example's influence reaches: too high produces tiny, jagged regions; too low can underfit with an overly smooth boundary. Tune C and gamma together through cross-validation.
model = make_pipeline(
StandardScaler(),
SVC(kernel='rbf', C=3, gamma='scale', probability=True),
)
Warning: probability=True adds extra fitting work and probability calibration machinery. Use it only when probabilities are actually needed and evaluate their calibration.
Tip: Scaling is essential because margins and kernels depend on distance. One large-unit feature can dominate the geometry.