(self, X)
return y
Predict is made by taking the maximum correlation coefficient
Predict is made by taking the maximum correlation coefficient
Predict is made by taking the maximum correlation coefficient
def predict(self, X):
        """Predict is made by taking the maximum correlation coefficient"""
        y = []
        for x in X:
            corr_f = {}
            for f in self.freqs:
                if f.replace(".", "", 1).isnumeric():
                    S_x, S_y = self.cca.fit_transform(x.T, self.Yf[f].T)
                    corr_f[f] = np.corrcoef(S_x.T, S_y.T)[0, 1]
            y.append(self.one_hot[max(corr_f, key=lambda k: corr_f[k])])
        return y
def predict ( self , X ) : y = [ ] for x in X : corr_f = { } for f in self . freqs : if f . replace ( "." , "" , 1 ) . isnumeric ( ) : S_x , S_y = self . cca . fit_transform ( x . T , self . Yf [ f ] . T ) corr_f [ f ] = np . corrcoef ( S_x . T , S_y . T ) [ 0 , 1 ] y . append ( self . one_hot [ max ( corr_f , key = lambda k : corr_f [ k ] ) ] ) return y