[SciPy-User] bug in svd ?

Pauli Virtanen pav@iki...
Mon Sep 26 08:09:35 CDT 2011


25.09.2011 18:15, pratik kirjoitti:
> I was using the scikits.learn package for pca analysis, but couldn't get
> the desired principal components (which were apparant from the structure
> of the data). So i just took the svd of the covariance matrix of the
> input data (after making the mean 0, of course). But on examining the
> singular values, i found that they are *NOT sorted in decreasing order*

Works for me:

    assert (numpy.diff(s) <= 0).all()

What does your `numpy.show_config()` say?

-- 
Pauli Virtanen



More information about the SciPy-User mailing list