(self, X)
return W[:, 0], W
Computation of TRCA spatial filters.

        Parameters
        ----------
        X: ndarray of shape (n_trials, n_channels, n_samples)
            Training data

        Returns
        -------
        W: ndarray of shape (n_channels)
            Weight coefficients for electrodes which can be used as
            a spatial filter.
Computation of TRCA spatial filters.
Computation of TRCA spatial filters .
def _compute_trca(self, X):
        """Computation of TRCA spatial filters.

        Parameters
        ----------
        X: ndarray of shape (n_trials, n_channels, n_samples)
            Training data

        Returns
        -------
        W: ndarray of shape (n_channels)
            Weight coefficients for electrodes which can be used as
            a spatial filter.
        """

        if self.method == "original":
            S, Q = self._Q_S_estim(X)
        elif self.method == "riemann" or self.method == "logeuclid":
            S, Q = self._Q_S_estim_riemann(X)
        else:
            raise ValueError(
                "Method should be either 'original', 'riemann' or 'logeuclid'."
            )

        # Compute eigenvalues and vectors
        lambdas, W = linalg.eig(S, Q, left=True, right=False)

        # Sort eigenvectors by eigenvalue
        arr1inds = lambdas.argsort()
        W = W[:, arr1inds[::-1]]

        return W[:, 0], W
def _compute_trca ( self , X ) : if self . method == "original" : S , Q = self . _Q_S_estim ( X ) elif self . method == "riemann" or self . method == "logeuclid" : S , Q = self . _Q_S_estim_riemann ( X ) else : raise ValueError ( "Method should be either 'original', 'riemann' or 'logeuclid'." ) # Compute eigenvalues and vectors lambdas , W = linalg . eig ( S , Q , left = True , right = False ) # Sort eigenvectors by eigenvalue arr1inds = lambdas . argsort ( ) W = W [ : , arr1inds [ : : - 1 ] ] return W [ : , 0 ] , W