Recently I've been interested in applying PCA to a dataset I have and I wanted to develop a deep understanding of what I would actually be doing when I implement it.
Today I encountered two confronting answers to the question of what is the maximum number of principal components. The two answers are these ones:
maxn_pc = min(n_samples, n_features). Supported by sklearn's documentation
Or this formula. Supported by this flawlessly looking argument.
if n_samples <= n_features: maxn_pc = n_samples - 1 else: maxn_pc = n_features
Do any of you know what is the meaning of that extra component that sklearn's PCA is offering?