1. Home
  2. Data Science
  3. Scikit-learn
  4. PCA(n_components=0.95) is fitted on standardised data…

Added 30 Nov -0001

PCA(n_components=0.95) is fitted on standardised data. What does the 0.95 select?

  1. Exactly 95 components, because an integer below 1 is read as a component count
  2. Components that individually explain at least 95% of the total variance each
  3. 95% of the original columns, chosen by their correlation with the first component
  4. The smallest number of components whose cumulative explained variance reaches 95% Correct answer

Correct answer

D. The smallest number of components whose cumulative explained variance reaches 95%

18 views

MCQSEXAM

Explanation

Explained variance ratio sums to 1 across all components, so passing a float below 1 to n_components keeps components until the cumulative sum reaches that fraction. The selected count is stored in n_components_ after fitting. Scaling first matters because PCA maximises variance, so an unscaled column measured in rupees would dominate one measured in metres.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Scikit-learn MCQs

Practise all Scikit-learn MCQs

Similar MCQs