mne.decoding.LinearModel#
- class mne.decoding.LinearModel(model=None)[source]#
Compute and store patterns from linear models.
The linear model coefficients (filters) are used to extract discriminant neural sources from the measured data. This class computes the corresponding patterns of these linear filters to make them more interpretable [1].
- Parameters:
- modelobject |
None A linear model from scikit-learn with a fit method that updates a
coef_attribute. If None the model will besklearn.linear_model.LogisticRegression.
- modelobject |
- Attributes:
- filters_
ndarray, shape ([n_targets], n_features) If fit, the filters used to decompose the data.
- patterns_
ndarray, shape ([n_targets], n_features) If fit, the patterns used to restore M/EEG signals.
- filters_
Methods
fit(X, y, **fit_params)Estimate the coefficients of the linear model.
Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
set_params(**params)Set the parameters of this estimator.
Notes
New in v0.10.
References
- fit(X, y, **fit_params)[source]#
Estimate the coefficients of the linear model.
Save the coefficients in the attribute
filters_and computes the attributepatterns_.- Parameters:
- X
array, shape (n_samples, n_features) The training input samples to estimate the linear coefficients.
- y
array, shape (n_samples, [n_targets]) The target values.
- **fit_params
dict Parameters to pass to the fit method of the estimator.
- X
- Returns:
- selfinstance of
LinearModel Returns the modified instance.
- selfinstance of
- get_metadata_routing()[source]#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routing
MetadataRequest A
MetadataRequestencapsulating routing information.
- routing
Examples using mne.decoding.LinearModel#
Linear classifier on sensor data with plot patterns and filters