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 [R3a399a9ea758-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 version 0.10.
References
- R3a399a9ea758-1
Haufe, S., Meinecke, F., Gorgen, K., Dahne, S., Haynes, J.-D., Blankertz, B., & Biebmann, F. (2014). On the interpretation of weight vectors of linear models in multivariate neuroimaging. NeuroImage, 87, 96-110.
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.
Methods
__hash__
(self, /)Return hash(self).
decision_function
(self, X)Compute distance from the decision function of y from X.
fit
(self, X, y, \*\*fit_params)Estimate the coefficients of the linear model.
fit_transform
(self, X, y)Fit the data and transform it using the linear model.
get_params
(self[, deep])Get parameters for this estimator.
predict
(self, X)Compute predictions of y from X.
predict_proba
(self, X)Compute probabilistic predictions of y from X.
score
(self, X, y)Score the linear model computed on the given test data.
set_params
(self, \*\*params)Set the parameters of this estimator.
transform
(self, X)Transform the data using the linear model.
-
__hash__
(self, /)¶ Return hash(self).
-
fit
(self, 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
-
set_params
(self, **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. Returns ——- self