2
$\begingroup$

I have a matrix of users each with his/her page view counts over 50 pages. So, I have data points with 50 dimensions each.

What I wanted to find was --> what combination of pages explains the user data the most?

I did PCA and got that the first component explains 80% of the data's variance.

But I can not figure out how do I get which dimensions contribute the most to that component? i.e. their weights in the linear combination.

Since, PCA component is just the linear combination of individual dimensions, I should be able to do that somehow.

Is my approach wrong or is any method better suited to extract the particular information?

Thanks for your help.

$\endgroup$
1
  • 1
    $\begingroup$ Look at this and this excellent discussions. $\endgroup$
    – Krrr
    Commented Aug 29, 2017 at 11:19

1 Answer 1

1
$\begingroup$

You're looking for eigenvector that corresponds to first singular value.

The problem with retrieving indices of its nonzero entries will most likely be that most or all entries are nonzero. That is because how PCA works - it finds the rotation of feature space such that its coordinates explain variance best along orthogonal directions.

Sparse PCA is used to retrieve sparse directions that explain the data best, with some constraints.

Sparse PCA is available for example in scikit-learn. You can also try to play with H2O's GLRM which is available in both R an Python.

$\endgroup$
6
  • $\begingroup$ thanks for the answer. PCA will have all the 50 dimensions, but I can retrieve the weights and set some threshold as to what is more important right? I will try GLRM (it is a family of models?, any specific algo?) and Sparse PCA..any other method to explore that could get me the desired info? Thanks again :) $\endgroup$
    – Rafael
    Commented Aug 29, 2017 at 6:49
  • 1
    $\begingroup$ You didn't specify what type of data you have, and GLRMs can model both continuous and categorical. If you're familiar with Eckart-Young theorem (or characterization of PCA as closest, in Frobenius norm, rank-k matrix) you can look up a notebook I have made on similar topic (direct generalization actually, for situations where only some matrix entries are given) here. $\endgroup$ Commented Aug 29, 2017 at 7:32
  • $\begingroup$ This is continuous data version (don't mind the input data being discrete, for this kind of GLRM you need to assume continuity to make sense). $\endgroup$ Commented Aug 29, 2017 at 7:34
  • $\begingroup$ @JakubBartczuk I think looking at eigenvector itself is not enough as it ignores eigenvalues. See the links that I posted a s comment to the question. $\endgroup$
    – Krrr
    Commented Aug 29, 2017 at 11:22
  • $\begingroup$ @DataD'oh OP only mentioned directions. I don't see what is the purpose of using eigenvalues, since they only scale the directions. Do you mean that you should guide how many eigenvectors to use? $\endgroup$ Commented Aug 29, 2017 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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