Search⌘ K

Kernel Trick Can Be Dangerous

Understand the potential risks of applying the kernel trick in machine learning algorithms. Learn how choosing an unsuitable kernel can lead to overfitting or underfitting and how model complexity in feature space affects generalization. This lesson guides you through selecting and validating kernels to balance model flexibility and performance effectively.

The use of the kernel trick seems very effective and efficient. Although not every machine learning algorithm can be reformulated to incorporate kernels, but many popular algorithms that rely on dot products, inner products, or distances can be reformulated to incorporate kernels. However, the use of kernels in machine learning algorithms can become dangerous when the choice of kernel isn’t appropriate for the given problem. For example, using a linear kernel on a highly nonlinear dataset can result in underfitting, while using a polynomial or RBF kernel on a linearly separable dataset can lead to overfitting.

The model complexity

While using the kernel trick, it is ...