Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix probabilities returned by label_components #36

Merged
merged 4 commits into from
May 6, 2022

Conversation

mscheltienne
Copy link
Member

Previous selection would return a square matrix, e.g. if 15 components were provided, we would go from (15, 7) shape to (15, 15) instead of (15, ).

@mscheltienne mscheltienne added the 🐞 bug Issue describes a bug (crash or error) or undefined behavior. label May 6, 2022
@mscheltienne mscheltienne self-assigned this May 6, 2022
@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #36 (4448d23) into main (d3ba4d6) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #36   +/-   ##
=======================================
  Coverage   96.26%   96.26%           
=======================================
  Files          12       12           
  Lines         509      509           
=======================================
  Hits          490      490           
  Misses         19       19           
Impacted Files Coverage Δ
mne_icalabel/label_components.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3ba4d6...4448d23. Read the comment docs.

mscheltienne added 2 commits May 6, 2022 16:02
@@ -56,7 +56,7 @@ def label_components(inst: Union[BaseRaw, BaseEpochs], ica: ICA, method: str):
labels_pred_proba = methods[method](inst, ica)
labels_pred = np.argmax(labels_pred_proba, axis=1)
labels = [ICLABEL_NUMERICAL_TO_STRING[label] for label in labels_pred]
y_pred_proba = labels_pred_proba[:, labels_pred]
y_pred_proba = labels_pred_proba[np.arange(15), labels_pred]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean predictions are always predicting 15 components? Even if ICA produces e.G. 30 components?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my god.. yes..
I was doing too many things at once, I'll fix it when I get home in 20 minutes.

@mscheltienne mscheltienne mentioned this pull request May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Issue describes a bug (crash or error) or undefined behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants