2
$\begingroup$

According to this paper, there are 2 algorithms to perform sparse PCA. One is better if $p>n$. I need to run SPCA on a $2000\times12000$ matrix so I am looking for an implementation of this algorithm. There is an sparse PCA implementation in sklearn and one in the R package elasticnet but I think they are the $n>p$ version.

Where can I find an implementation of this algorithm?

$\endgroup$
1
$\begingroup$

A possible solution is to use the standard sparse PCA algorithm and increase the ridge penalty coefficient.

There are probably better solutions but this is what I did.

$\endgroup$
1
$\begingroup$

Have a look at the nsprcomp package for R. It implements sparse and/or non-negative PCA and is efficient for $p \gg n$ because it only uses the data matrix and not the covariance matrix. A comparison to arrayspc from the elasticnet package is given in this blog post.

$\endgroup$
0
$\begingroup$

You should check out Scikit-Learn's implementation and see if it matches what you are looking for.

I don't know about the $n<p$ constraint, but it might be worth trying out and looking at the performance either way.

$\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.