Skip to content

Commit

Permalink
- Fixed BLDA fit
Browse files Browse the repository at this point in the history
 On branch master
 Your branch is up to date with 'origin/master'.

 Changes to be committed:
	modified:   baseline/erp/blda.py
  • Loading branch information
okbalefthanded committed Sep 28, 2022
1 parent 27790c7 commit 3e07532
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions baseline/erp/blda.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def fit(self, X, y=None):
d.sort()
v = v[:, sort_perm]
d = d.reshape( (d.shape[0],1) )
vxy = np.linalg.multi_dot([v.T, X, y.T]) # dito
vxy = np.linalg.multi_dot([v.T, X, yy.T]) # dito
vxy = vxy.reshape((vxy.shape[0], 1)) # dito
e = np.ones( (n_features-1,1)) # dito

Expand All @@ -78,7 +78,7 @@ def fit(self, X, y=None):
alphaold = alpha
betaold = beta
m = beta * np.dot(v , np.multiply( np.power(beta*d+np.vstack((alpha*e, biasalpha)), -1), vxy) )
err = np.sum( np.power( y-np.dot(m.T,X), 2 ) )
err = np.sum( np.power( yy-np.dot(m.T,X), 2 ) )
gamma = np.sum( np.true_divide(beta*d, beta*d+np.vstack((alpha*e, biasalpha))) )
alpha = gamma / np.asscalar(np.dot(m.T,m))
beta = (n_examples - gamma) / err
Expand Down

0 comments on commit 3e07532

Please sign in to comment.