Plenty of real data isn't linearly separable. No straight line (or hyperplane) splits the two classes cleanly. The classic fix is to map the data into a higher-dimensional space where it does become linearly separable — e.g. lifting 2D points onto a paraboloid in 3D turns a circular boundary into a flat plane.
Computing coordinates in a high — sometimes infinite — dimensional space is expensive or impossible. But the SVM optimization only ever needs the dot product between pairs of transformed points, never their individual coordinates. A kernel function computes that dot product directly in the original space, without ever constructing the high-dimensional vectors.
The most common default. Intuitively, it measures similarity that decays with distance — points close together look similar, far points don't. The gamma parameter controls how fast that similarity decays:
Computes dot products as if data had been expanded into polynomial combinations of features, controlled by a degree parameter. Useful when you have reason to believe interactions between features matter up to a specific order.
from sklearn.svm import SVC
rbf_clf = SVC(kernel='rbf', gamma='scale', C=1.0)
poly_clf = SVC(kernel='poly', degree=3, C=1.0)
rbf_clf.fit(X_train, y_train)
Training cost scales roughly quadratically to cubically with the number of samples, because the algorithm needs pairwise comparisons between all training points (the kernel matrix). Beyond tens of thousands of samples, kernel SVMs get slow — linear SVMs or other models become the practical choice.
gamma trades off boundary tightness against smoothness — tune it like any other regularization-adjacent parameter.