Kernel PCA

Kernel PCA is a technique that uses a kernel to map the signal on a (typically) nonlinear space and makes it linearly separable (or close to attaining the same). It's an extension of PCA, where the mapping is an actual projection on a linear subspace. There are many well-known kernels (and of course, you can always build your own on the fly), but the most used ones are linear, poly, RBF, sigmoid, and cosine. They all serve different configurations of input datasets as they are only able to linearize some selected types of data. For example, let's imagine that we have a disk-shaped dataset, like the one we are going to create with the following code:

In: def circular_points (radius, N): return np.array([[np.cos(2*np.pi*t/N)*radius, ...

Get Python Data Science Essentials - Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.