Principal Component Analysis (PCA)

In previous section we applied several machine learning techniques to the entire mnist dataset. We had a preprocessing step, where we filtered the most relevant pixels. However many predictors were still redundant and it is possible to improve the models.

We will apply SVD and PCA analysis on the mnist digit dataset. The original data has 784 pixels, used as predictors, and this is a good example for dimension reduction.
Because the pixels are so small, pixels close to each other on the grid tend to be correlated, allowing dimension reduction.

The following graphic shows the variability of each of the 784 principal components.

We can see that the first few PCs already explain a large percent of the variability.

The importance of the first PCs is more evident by looking the cumulative sum of variabilities.

With over 40 PCs we already are able to explain about 80% of the variability of the entire data.
We take a random sample of 2,000 digits and look how they are scattered between the first two principal components. It is possible to see that some classes have their points gathered in groups.