Kernel Linear Discriminant
Explore the concept of kernel linear discriminant analysis, which extends traditional linear discriminants to nonlinear classification by using kernel methods. Understand how to implement these models with generalized linear regression, visualize decision boundaries, and apply one-hot encoding for multiclass problems in Python.
In the previous lessons, we explored kernels, the kernel trick, and the Gram matrix.
We saw how kernels enable us to model nonlinear patterns by implicitly mapping data into a higher-dimensional feature space without explicitly computing that space. In this lesson, we extend those ideas to discriminant analysis.
Kernel linear discriminant models build decision boundaries in the feature space induced by a kernel function.
This enables us to construct nonlinear classification boundaries in the original input space while maintaining a linear model in the feature space. We begin with the traditional discriminant function, introduce its generalized linear form using feature mappings, develop the two-class kernel formulation, and then extend the approach to multiclass settings using one-hot targets.
Finally, we implement the method and visualize the resulting decision boundaries.
Discriminant function
Discriminant analysis aims to classify observations into one of classes using predictor variables. Formally, consider a dataset: , where and .
A discriminant function assigns any new input to one of the classes. In linear discriminant analysis, this function is typically linear in , but kernel methods allow us to generalize this idea.
Generalized linear discriminant function
A generalized linear discriminant is a discriminant function that is linear not in the original input , but in the transformed feature space . This replaces the standard linear form with ...