Skip to content

Commit

Permalink
note that inverse transform is applied in reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjr committed Feb 20, 2017
1 parent 25af46f commit a0202ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/decoding/plot_linear_model_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@

# Extract and plot patterns and filters
for name in ('patterns_', 'filters_'):
# The `inverse_transform` parameter will call this method on any estimator
# contained in the pipeline, in reverse order.
coef = get_coef(clf, name, inverse_transform=True)
evoked = EvokedArray(coef, epochs.info, tmin=epochs.tmin)
evoked.plot_topomap(title='EEG %s' % name[:-1])
2 changes: 2 additions & 0 deletions mne/decoding/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ def get_coef(estimator, attr='filters_', inverse_transform=False):
raise ValueError('inverse_transform can only be applied onto '
'pipeline estimators.')

# The inverse_transform parameter will call this method on any
# estimator contained in the pipeline, in reverse order.
for inverse_func in _get_inverse_funcs(estimator)[::-1]:
coef = inverse_func([coef])[0]
return coef

0 comments on commit a0202ce

Please sign in to comment.