question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Store the scores alongside the components chosen by find_bads_eXg methods.

See original GitHub issue

Following a discussion on the forum with @hoechenberger I could not find a way to recover the information I was looking for.

Following an ICA, I saved to disk both the ICA instance and the raw instance on which the ICA is applied.

ica = mne.preprocessing.ICA(method='picard', max_iter='auto', random_state=101)
ica.fit(raw, picks='eeg')
eog_idx, eog_scores = ica.find_bads_eog(raw)
ecg_idx, ecg_scores = ica.find_bads_ecg(raw)
ica.exclude = eog_idx + ecg_idx
ica.apply(raw)

ica.save()
raw.save()

I wanted to check how well the adaptative Z-score threshold worked (I like smart algo, but I don’t trust them blindly). After posting on the forum, and looking for a while, I could retrieve the separation between excluded components corresponding to EOG-related activity and ECG-related activity. This information is stored in ica.labels_. However, I could not recover the scores that lead to this component selection.

I ended up rerunning part of my pipeline and saving the scores separately, but it was very surprising for me that I could not recover this information from the ICA instance. After looking a bit into the code, it was clear to me that the scores were not saved anywhere. I propose to add an additional attribute similar to labels_ but for the scores.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:22 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
hoechenbergercommented, May 3, 2022

Thanks @agramfort ! will do so after making v0.1 release on pypi(?).

Once that’s done, LMK and I can create a conda-forge package too, so we can include this in the installer!

2reactions
agramfortcommented, May 4, 2022

Ok transfer done

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found