bugfix on shape

This commit is contained in:
Arnar Flatberg 2007-01-31 11:57:59 +00:00
parent 8e607c7b1a
commit 29509902df

View File

@ -93,7 +93,7 @@ def pls(a, b, aopt=2, scale='scores', mode='normal', ab=None):
ab = dot(a.T, b)
for i in range(aopt):
if ab.shape[1]==1:
w = ab.reshape(mm, l)
w = ab.reshape(n, l)
else:
u, s, vh = svd(dot(ab.T, ab))
w = dot(ab, u[:,:1])
@ -246,7 +246,7 @@ def esvd(data,economy=1):
s[i] = norm(u[:,i])
u[:,i] = u[:,i]/s[i]
else:
u, s, vt = svd(data, data.T)
u, s, vt = svd(dot(data, data.T))
v = dot(u.T, data)
for i in xrange(m):
s[i] = norm(v[i,:])