meeg_utils.steps.Regression#
- class meeg_utils.steps.Regression(artifact='ref_meg', *, picks=None)[source]#
Remove what reference or artifact channels record from the data, by linear regression.
Wraps
mne.preprocessing.EOGRegression: each data channel is regressed on the artifact channels (means removed) and the fitted contribution is subtracted. Coefficients are learned infitand reused bytransform.artifact="ref_meg"(default): environmental noise recorded by the reference magnetometers of KIT/Ricoh, BTi/4D, Artemis123 and CTF systems is removed from the MEG channels (least-squares reference regression; for CTF, the vendor’s synthetic gradiometers,Referencewithctf_grade=3, are the usual alternative and the data must be at grade 0).artifact="eog"(or"ecg", a list of channels): regression of ocular artifacts (Gratton et al., 1983, Electroencephalogr Clin Neurophysiol 55:468). It also removes the brain activity the EOG electrodes pick up; ICA is usually preferable. Set the EEG reference first (Reference); MNE requires it.
- Parameters:
- model_#
The fitted regression (
coef_: data channels x artifact channels).
- qc_#
n_channels,n_artifact_channels,artifact_channels,variance_removed_pct(fitted data) and per channel typepower_change_db(last transform). Both ignore offsets (the mean over time), which the regression leaves alone.- Type:
- psd_#
Per channel type, PSDs of the cleaned channels before and after the last transform.
- Type:
Notes
Figures (
plot()):"psd", spectra before and after.Methods
__init__([artifact, picks])fit(inst[, y, system])Learn the step's state from the data.
fit_transform(inst[, y, system, copy])Fit the step on the data and transform the same data.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
plot([kind, inst])Draw quality-control figures.
set_fit_request(*[, inst, system])Configure whether metadata should be requested to be passed to the
fitmethod.set_params(**params)Set the parameters of this estimator.
set_transform_request(*[, copy, inst])Configure whether metadata should be requested to be passed to the
transformmethod.transform(inst, *[, copy])Apply the fitted step to the data.
Attributes
Data types the step accepts.
adds_annotationsWhether the step may add
BAD_annotations (existing ones are kept).changes_channelsWhether the step may add, drop or reorder channels.
changes_timesWhether the step may change the time axis (e.g. resampling, cropping).
drops_epochsWhether the step may drop epochs (e.g. artifact rejection).
kind -> whether it needs data (
inst).returnsData type the step returns;
Nonemeans the same type as its input.systemsAcquisition systems the step applies to;
Nonemeans all systems.