On Wed, Sep 4, 2013 at 11:44 AM, Gael Varoquaux <notifications@github.com>wrote:

> In sklearn/decomposition/factor_analysis.py:
>
> > @@ -140,20 +147,31 @@ def fit(self, X, y=None):
> >          loglike = []
> >          old_ll = -np.inf
> >          SMALL = 1e-12
> > +
> > +        # we'll modify svd outputs to return unexplained variance
> > +        # to allow for unified computation of loglikelihood
> > +        if self.algorithm == 'svd':
> > +            def my_svd(X):
> > +                U, s, V = linalg.svd(X, full_matrices=False)
> > +                return (s[:n_components], V[:n_components],
> > +                        np.sum(s[n_components:] ** 2))
> > +        elif self.algorithm == 'randomized-svd':
> > +            def my_svd(X):
> > +                U, s, V = randomized_svd(X, n_components)
>
>  @ogrisel <https://github.com/ogrisel> @GaelVaroquaux<https://github.com/GaelVaroquaux>
> @agramfort <https://github.com/agramfort> I did some testing and it turns
> out that both parameters can help to equalize the outputs produced by both
> svd methods. On real data randomized svd might generate scores that
> significantly deviate from FA scores based on SVD. Setting n_iter to 3
> solves the problem, but also setting n_oversamples to e.g. 100 helps. Both
> can be combined like n_iter=1 and n_oversamples=20. We should probably
> expose these parameters because these values aren't supposed to be
> constants ...
> Yes, but they are probably difficult to tune unless you really know what
> you are doing. Can we expose only one of them (and figure out which one
> matters most)?
>
>


I get good results with n_iter=3 which would be consistent with
RandomizedPCA's defaults.
This is also faster than using n_over samples = 50 to get about the same
result.
Hence, my vote: expose `n_iter` and name it `iterated_power` as in
RandomizedPCA



—
> Reply to this email directly or view it on GitHub<https://github.com/scikit-learn/scikit-learn/pull/2406/files#r6149318>
> .
>