X = epochs.pick_types(eeg=True)
y = epochs.events[:, -1]
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], time_unit='s')
ValueError: Data must be a 2D array of shape (n_channels, n_samples), got shape (3, 14, 32)
Tried reshaping also. Not able to understand EvokedArray and get_coef.
Can someone help me resolve this error?
Using my own data (EEG channels + label). Have used vectorizer between mne and scikit-learn also.
Using the same clf first.
clf = make_pipeline(
Vectorizer(), # 1) vectorize across time and channels
StandardScaler(), # 2) normalize features across trials
LinearModel( # 3) fits a logistic regression
LogisticRegression(solver='liblinear')
)
)
clf.fit(X, y)
Let me know if you need more details.
Can you please help me resolve this error?
This is important for us to be able to help you. If you donβt do this, it means we have to
use different data than you
write our own code to load the data
write our own code to preprocess the raw data into Epochs
figure out what packages your various functions come from (since your code doesnβt include any import statements)
It is impossible for us to do that for every question on this forum, there is simply not enough time. Please try to write a minimal working example that includes all necessary imports, data loading, etc. Try to reproduce your error with the MNE sample data or some other built-in dataset. If you cannot replicate with a built-in dataset, then provide a link where we can download the data that does cause the error. Finally, when you get an error, please copy/paste the full traceback printed in the console, not just the final error message. Sometimes seeing that helps us a lot to pinpoint where the problem is coming from.