How can an SVM draw a circle when it can separate points only with a line? A polynomial kernel adds polynomial features so a nonlinear dataset becomes linearly separable in a higher-dimensional space. For two inputs, degree-2 features can include x1², x1x2, and x2²; a plane there can project back to a circular, parabolic, or hyperbolic boundary. section 11.3 section 11.4
Follow the geometric idea:
- Start with points that a line cannot separate. section 11.3
- Add columns representing polynomial terms, such as x1², x1x2, and x2². section 11.3
- Separate the expanded points with a plane, then view its projected boundary in the original inputs. section 11.3
- Choose the polynomial degree to model regions shaped by polynomial equations; compare this with the RBF kernel for more complex curved regions. section 11.4
Classifying a noisy circle
A circular dataset cannot be separated well by a line, but the relation x1² + x2² = 1 describes a circle. Fit a degree-2 polynomial SVM with `svm_degree_2 = SVC(kernel='poly', degree=2)`, then inspect the resulting curved classifier. section 11.3
Figure 11.14 Left: The set is not separable by a line. Middle: We look at it in three dimensions, and proceed to raise the two triangles and lower the two squares. Right: Our new dataset is now separable by a plane. (Source: Image created with the assistance of Grapher™ from Golden Software, LLC; https://www.goldensoftware.com/products/grapher).
Visualizes how adding a feature lifts a nonseparable planar dataset into three dimensions, where a plane can separate it. section 11.3
