It looks like the transpose may make the system under-determined. If you
try with

X = np.random.randn(*X.shape)

What happens?


On Thu, Jul 31, 2014 at 4:17 PM, Kyle Kastner <[email protected]> wrote:

> What is the shape of X
>
>
> On Thu, Jul 31, 2014 at 4:14 PM, Deepak Pandian <[email protected]
> > wrote:
>
>> On Thu, Jul 31, 2014 at 7:31 PM, Olivier Grisel
>> <[email protected]> wrote:
>> > The sign of the components is not deterministic. The absolute values
>> > should be the same.
>>
>> But the last component differs even in absolute values,
>> Pca_components:
>> [[-0.61098855  0.54326104  0.3089728   0.29598692 -0.01767037  0.25638981
>>   -0.24499776 -0.02891609 -0.10832649  0.09922362]
>>  [-0.04285247  0.58774877 -0.02102497 -0.18987243 -0.09547488 -0.37323125
>>    0.62203739  0.03558049  0.0780125  -0.27114941]
>>  [ 0.3481033   0.32602361 -0.20594773 -0.26088651 -0.63592937  0.39839983
>>   -0.20642102 -0.23287936 -0.0447964   0.00887286]]
>>
>> SVD on X (matches pca since it follows the same steps)
>> Below is V from svd of (X)
>> [[-0.61098855  0.54326104  0.3089728   0.29598692 -0.01767037  0.25638981
>>   -0.24499776 -0.02891609 -0.10832649  0.09922362]
>>  [-0.04285247  0.58774877 -0.02102497 -0.18987243 -0.09547488 -0.37323125
>>    0.62203739  0.03558049  0.0780125  -0.27114941]
>>  [ 0.3481033   0.32602361 -0.20594773 -0.26088651 -0.63592937  0.39839983
>>   -0.20642102 -0.23287936 -0.0447964   0.00887286]
>>
>>
>> SVD on X.T:
>>
>> Below is U.T of SVD(X.T)
>> [-0.61098855  0.54326104  0.3089728   0.29598692 -0.01767037  0.25638981
>>   -0.24499776 -0.02891609 -0.10832649  0.09922362]
>>  [-0.04285247  0.58774877 -0.02102497 -0.18987243 -0.09547488 -0.37323125
>>    0.62203739  0.03558049  0.0780125  -0.27114941]
>>  [ 0.39253032  0.27426443 -0.09946156 -0.17669364 -0.55699776  0.60982874
>>    0.0461356  -0.18837449 -0.04298647  0.08936917]
>>
>> You can see that the final component doesn't match in terms of absolute
>> values.
>>
>>
>> I am pasting the code I used for svd(X.T) to check if I am making some
>> mistakes here.
>> def svd_t(X):
>>     #x.shape = n_features,n_samples
>>     #every sample is a column
>>     mean= np.mean(X,axis=1)
>>     mean = mean[:,np.newaxis]
>>     X = X -mean
>>     u,s,v = np.linalg.svd(X,full_matrices=True)
>>     return u,s,v
>>
>>
>> Thanks
>> Deepak
>>
>> --
>> With Regards,
>> Deepak Pandian
>> "Deconstructing world one piece at a time"
>>
>>
>> ------------------------------------------------------------------------------
>> Infragistics Professional
>> Build stunning WinForms apps today!
>> Reboot your WinForms applications with our WinForms controls.
>> Build a bridge from your legacy apps to the future.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Scikit-learn-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
>>
>
>
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to