0
$\begingroup$

Correct me if I am wrong anywhere.

  1. I understand PCA is used to determine what component(s) of a given dataset could be of more use than the other.
  2. By #1, I understand, for a structured dataset (with n columns and k rows), PCA will help us determine what column(s) could be useful to predict the outcome.
  3. Plotting the explained_variance_ will show us, graphically, what components are useful, that is to say, if the graph begins to straighten, we may discard the variables there.
  4. Here's my graph. There are 31 variables (columns) and the graph starts to straighten out at 11-isih, I guess?

enter image description here

  1. So from what I have understood about PCA, we may discard the variables from 11 and beyond and the model built using this would still manage to score well.

And here lies my confusion: In the X axis, what number correspond to what variables? Like, does 1 mean that first columns of the dataframe? Obviously not, right?

$\endgroup$
6
$\begingroup$

Your confusion starts at 1. PCA is not a variable selection method. It is a linear transformation method that linearly transforms your predictors into so-called "principal components".

If you decide to use the first 11 "PCA variables" based on your variance plot, you will need to use the first 11 principal components. These will be quite different from the original predictors, and usually nontrivial to interpret.

We have an enormously good thread on PCA: Making sense of principal component analysis, eigenvectors & eigenvalues. Very much recommended.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ There are various procedures to pick "principal variables" but -- entirely consistently with Stephan's point -- they are different -- and much less often discussed. $\endgroup$ – Nick Cox Apr 30 '19 at 16:02

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.