ayushigupta97 / BCI_competition_III_2DLDA_svm

Physical Activity Recognition Using Brain Signals
7 stars 2 forks source link

def LDA2D seems to have a mistake #3

Open ruisukun21 opened 2 years ago

ruisukun21 commented 2 years ago

the following part in line 57 makes no sense

        for j in range(len(dd)):
            t=[]
            for k in range(len(X)):
                t.append(X[k][j])
            a=np.array(t)
            X1.append(a)

Perhaps the intended code is:

        for j in dd:
            t=[]
            for k in range(len(X)):
                t.append(X[k][j])
            a=np.array(t)
            X1.append(a)

the sb variable should correpond to Scatering between but it is actually implementing scatering within. I wonder why?

Is the implemented code theoretically accurate?
In the Fisher flavor of lda : U that maximizes trace (U.T S_total U) subject to U.T S_within U (see "Roweis discriminant analisys" for an example) but the code maximizes S_between while minimizing (S_total+S_between). I wonder is this theoretically sounding?

Is there a reason to use matrix inversion instead of using generalized eigen decomposition?

xhmkggybza commented 1 year ago

I also think there is a problem in this place, so have you found a more reasonable 2DLDA code

xhmkggybza commented 1 year ago

in python

ruisukun21 commented 1 year ago

I utilized 2DLDA for the comparison methods for a paper on palmprint identification. I think I made it from scratch, let me see If I can upload it later.