Now that we have trained our PCA model, what is the result? Let's inspect the dimensions of the resulting matrix:
val rows = pc.numRows val cols = pc.numCols println(rows, cols)
As you should see from your console output, the matrix of the principal components has 2500 rows and 10 columns.
Recall that the dimension of each image is 50 x 50, so here, we have the top 10 principal components, each with a dimension identical to that of the input images. These principal components can be thought of as the set of latent (or hidden) features that capture the greatest variation in the original data.