Skip to content

Commit

Permalink
- Modified BLDA, SWLDA:
Browse files Browse the repository at this point in the history
  - Added predict_proba
 On branch master
 Your branch is up to date with 'origin/master'.

 Changes to be committed:
	modified:   baseline/erp/blda.py
	modified:   baseline/erp/swlda.py
  • Loading branch information
okbalefthanded committed Jun 26, 2022
1 parent f1e6b71 commit 462c15f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 3 additions & 4 deletions baseline/erp/blda.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,11 @@ def decision_function(self,X):
return np.dot(X.T, self.w)

def predict(self, X, y=None):
return self.decision_function(X)

return self.decision_function(X)

def score(self,X, y=None):
pass

def predict_proba(self,X):
pass
def predict_proba(self, X):
return self.decision_function(X)

4 changes: 3 additions & 1 deletion baseline/erp/swlda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from sklearn.metrics import accuracy_score
from sklearn.utils.extmath import softmax
from .stepwise.stepwise import stepwisefit
from copy import deepcopy
import numpy as np

class SWLDA(BaseEstimator, ClassifierMixin):
Expand Down Expand Up @@ -43,4 +44,5 @@ def score(self,X, y=None):
return accuracy_score(y, self.predict(X))

def predict_proba(self,X):
return softmax(self.decision_function(X))
# return softmax(self.decision_function(X))
return self.decision_function(X)

0 comments on commit 462c15f

Please sign in to comment.