'Estimate epochs sources given the CSP filters.
Parameters
X : array, shape (n_epochs, n_channels, n_times)
The data.
Returns
X : ndarray
If self.transform_into == \'average_power\' then returns the power of
CSP features averaged over time and shape (n_epochs, n_sources)
If self.transform_into == \'csp_space\' then returns the data in CSP
space and shape is (n_epochs, n_sources, n_times)'

def transform(self, X):

    if (not isinstance(X, np.ndarray)):
        raise ValueError(('X    should    be    of    type    ndarray    (got    %s).' % type(X)))
    if (self.filters_ is None):
        raise RuntimeError('No    filters    available.    Please    first    fit    CSP    decomposition.')
    pick_filters = self.filters_[:self.n_components]
    X = np.asarray([np.dot(pick_filters, epoch) for epoch in X])
    if (self.transform_into == 'average_power'):
        X = (X ** 2).mean(axis=2)
        log = (True if (self.log is None) else self.log)
        if log:
            X = np.log(X)
        else:
            X -= self.mean_
            X /= self.std_
    return X
