You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Perf: PCA(n_components="mle") uses O(d^3) version of Minka's algorithm when O(d^2) exists #34618
PCA(n_components="mle") is very slow on large datasets since it runs in O(d^3) where d=min(n_features, n_samples) and has considerable Python loop overhead.
We should port that to Python, or at least the core pa reformulation that makes each rank evaluation linear time instead of quadratic. There are a few more tweaks in there, some of which were added years later, that are probably good ideas but would change the behavior of the function slightly. I propose we just port the runtime improvement without changing behavior; future work can look into adapting some of the other improvements.
Describe alternatives you've considered, if relevant
Activity
jberg5 commentedon Jul 31, 2026
Pasting Minka's matlab implementation here since it's buried in the zipfile:
cakedev0 commentedon Oct 12, 2026
This is not a new feature, but just an optimization. But it looks like a good optimization, thanks for pointing it. I'll take a look at your PR.