ncrf.NCRF

class ncrf.NCRF(forward, theta, design)

Fitted NCRF model that can be applied to compatible datasets.

Holds the estimated weights together with the forward model and stimulus design needed to reconstruct response functions, predict whitened sensor data, and evaluate predictions. Reusable and picklable; produced by NCRFEstimator.fit() and exposed as NCRFFit.model.

forward

The internal forward-model state (lead field, whitening filter, and source, sensor, and orientation dimensions).

theta

Fitted NCRF coefficients over the Gaussian basis, shape (source, stimulus * lag): rows are the source dipoles in lead-field order (orientation varying fastest), columns are the predictors of design concatenated, each ordered by stimulus with lag varying fastest.

design

Stimulus, basis, and normalization metadata of the data the model was fit on, including the TRF timing (design.tstart, design.tstep, design.tstop) and the Gaussian-basis width (design.basis_std). Pass it to normalize() to bring another dataset onto the same scale.

Methods

evaluate(data[, metrics])

Score predictions on data with one or more metrics.

predict(data, *[, whitened])

Predict sensor-space data for each segment.

voxelwise_explained_variance(data)

Compute each source's contribution to explained variance.

Attributes

h

The spatio-temporal response function as (list of) eelbrain.NDVar.

h_scaled

h with the covariate normalization undone.