Skip to content

Comments

[WIP] Enhance distance and gpf metrics#161

Draft
vferat wants to merge 89 commits intomainfrom
dev-meeg
Draft

[WIP] Enhance distance and gpf metrics#161
vferat wants to merge 89 commits intomainfrom
dev-meeg

Conversation

@vferat
Copy link
Owner

@vferat vferat commented Feb 16, 2024

#160

  • Change correlation computation to use cosine similarity
  • Change gfp to either use std or rms

TODO:

  • make sure to use correlation and gfp whenever its needed

vferat and others added 30 commits February 16, 2024 16:22
@@ -317,7 +332,10 @@ def _compute_maps(
for _ in range(max_iter):
# Assign each sample to the best matching microstate
activation = maps.dot(data)
Copy link
Owner Author

Choose a reason for hiding this comment

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

use distance here ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good.

return dist


def _gev(data, maps, segmentation):
Copy link
Owner Author

Choose a reason for hiding this comment

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

this is only explained variance

@vferat
Copy link
Owner Author

vferat commented Mar 3, 2025

This PR addresses also addresses #197 and #220, and brings a significant refactoring of the code. The main goal is to consolidate the distance metric into a single function, which helps avoid confusion between different distance definitions (e.g., Euclidean, correlation, etc.). This refactor also facilitates the introduction of the ignore_polarity parameter, which is essential for resolving issue #116.

Key improvements:

A single function now handles all distance metric calculations, making the code more maintainable and flexible.
The new structure makes it easier to implement additional distance definitions in the future, should they be needed.
The ignore_polarity parameter has been integrated

In my testing, the results from the tutorial builds remain consistent with the previous behavior when ignore_polarity=True. I will conduct a more comprehensive comparison between the current PR code and the main branch to ensure there are no discrepancies before the PR is reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants