Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

bugfix on shape

This commit is contained in:
Arnar Flatberg 2007-01-31 11:57:59 +00:00
parent 8e607c7b1a
commit 29509902df
1 changed files with 2 additions and 2 deletions

View File

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