pyeeg.models.TRFEstimator.fit

TRFEstimator.fit(X, y, lagged=False, drop=True, feat_names=(), rotations=())

Fit the TRF model.

Parameters:
  • X (ndarray (nsamples x nfeats)) – Array of features (time-lagged or not, if it is, then second dim’s shape should be nfeats*nlags)

  • y (ndarray (nsamples x nchans)) – EEG data

  • lagged (bool) – Default: False. Whether the X matrix has been previously ‘lagged’ (intercept still to be added).

  • drop (bool) – Default: True. Whether to drop non valid samples (if False, non valid sample are filled with 0.)

  • feat_names (list) – Names of features being fitted. Must be of length nfeats.

  • rotations (list of ndarrays (shape (nlag x nlags))) – List of rotation matrices (if V is one such rotation, V @ V.T is a projection). Can use empty item in place of identity matrix.

Returns:

  • coef_ (ndarray (nlags x nfeats x nchans))

  • intercept_ (ndarray (nchans x 1))