2
$\begingroup$

Why don't all feature selection methods in sklearn allow specifying desired variance explained?

sklearn.decomposition.PCA does allow inputting a percentage of variance that one wants to be explained in place of n_components. However other methods such as SparsePCA expect the user to "know" how many n_components he/she wants to take.

$\endgroup$
3
$\begingroup$

Because PCA is just one of the feature selection methods, don't expect others to have a tractable computable formula to specify ahead of time the optimal number of new features.
I suggest to start reading on Representation learning, and what we mean by latent variables.

$\endgroup$
3
$\begingroup$

The theory behind PCA involves variance as an important concept. That's not necessarily true for other methods. Note that different methods also have different "figures of merit" for the quality of the outcome. There are many different methods, and you might want to (a) understand what outcomes and quality-metrics are associated with the methods of interest, and (b) develop familiarity with how other people have used and interpreted these quality-metrics. I've made some big mistakes by not understanding properly the interpretive conventions about certain metrics (e.g., stress in multi-dimensional scaling). The community has more wisdom than any one of us - use the community (and contribute back to the community)!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.