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 be LogisticRegression.
- modelobject |
Notes
New in v0.10.
References
- Attributes:
Methods
fit
(X, y, **fit_params)Estimate the coefficients of the linear model.
get_params
([deep])Get parameters for this estimator.
set_params
(**params)Set the parameters of this estimator.
- 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:
- Returns:
- selfinstance of
LinearModel
Returns the modified instance.
- selfinstance of
Examples using
fit
:Linear classifier on sensor data with plot patterns and filters
Linear classifier on sensor data with plot patterns and filters
- set_params(**params)[source]#
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters:
- **params
dict
Parameters.
- **params
- Returns:
- instinstance
The object.
Examples using mne.decoding.LinearModel
#
Linear classifier on sensor data with plot patterns and filters