By looking the first four matrix factorizations, we verify that the first 2 are responsible for most of the pixels (blue and red positive and negative values respectively and white being zero).

Knn method over PCA

Since the first 40 components are responsible for over 80% of the data, we will use these 40 components to fit some classification models, presented in previous study.
We will first fit the model.
We use 10-fold cross validation to tune the best k parameter.

With the best k parameter tuned, we fit the model and transform the test set to look the result.

Below we show 12 examples of correct predictions of the test set.

Following are 12 examples of incorrect predictions, with their true classification and prediction.

The accuracy achieved with knn over 40 principal components was very high, above 95% and in our case, was better than the accuracy achieved in previous knn model, with the entire dataset.

Random Forest Rborist over PCA

We use 5-fold cross validation and a small sample to tune the best parameter.

We apply the best parameter tuned and fit the model with the entire training set to look the result.

Following we show 12 examples of incorrect predictions, with their true classification and prediction.

Random forest model with only 40 principal components also achieved a high accuracy, similar to the model with entire set. Both got an accuracy above 95%.