Background:
I'm doing research using EigenFaces with Python. I need to extract any principal component of multiple images, and use those selected principal components to do feature reduction and face identification with a training dataset of images.
Problem:
In sklearn
, the PCA function allows specifying only n_components
, which would take the first n
number of principal components. But I need to be able to select any principal component individually, because I need to try using a random combination of multiple principal components, to do the feature reduction and Eigen faces computation. That's part of the research requirement.
I noticed some bespoke implementations here and here, but I'd prefer a more standard library, to avoid errors in the results. Also noticed another PCA library which does not seem to offer low-level functions to obtain more details that I need.
Is there any reliable way to get the individual principal components using Python?