PCA is good at reducing the number of dimensions, but it works in a linear manner. If the data is not organized in a linear fashion, PCA fails to do the required job. This is where kernel PCA enters the picture.
Performing kernel principal component analysis
Getting ready
In this recipe, we will see how we can perform a kernel PCA on the input data and compare the result to how PCA performs on the same data.
How to do it...
Let's see how we can perform a kernel PCA:
- Create a new Python file and import the following packages (the full code is given in the kpca.py...