'Generate predictions with a receptive field.
Parameters
X : array, shape (n_times[, n_epochs], n_channels)
The input features for the model.
Returns
y_pred : array, shape (n_times[, n_epochs][, n_outputs])
The output predictions. "Note that valid samples (those
unaffected by edge artifacts during the time delaying step) can
be obtained using ``y_pred[rf.valid_samples_]``.'

def predict(self, X):

    if (not hasattr(self, 'delays_')):
        raise ValueError('Estimator    has    not    been    fit    yet.')
    (X, _, X_dim) = self._check_dimensions(X, None, predict=True)[:3]
    del _
    if isinstance(self.estimator, TimeDelayingRidge):
        X = _pad_time_series(X, n_delays=len(self.delays_), fill_mean=self.fit_intercept)
    pred_shape = X.shape[:(-1)]
    if (self._y_dim > 1):
        pred_shape = (pred_shape + (self.coef_.shape[0],))
    (X, _) = self._delay_and_reshape(X)
    y_pred = self.estimator_.predict(X)
    y_pred = y_pred.reshape(pred_shape, order='F')
    if isinstance(self.estimator, TimeDelayingRidge):
        y_pred = y_pred[:(- (len(self.delays_) - 1))]
    shape = list(y_pred.shape)
    if (X_dim <= 2):
        shape.pop(1)
        extra = 0
    else:
        extra = 1
    shape = shape[:(self._y_dim + extra)]
    y_pred.shape = shape
    return y_pred
