pycrostates
pycrostates copied to clipboard
[WIP] Enhance distance and gpf metrics
#160
- [x] Change correlation computation to use cosine similarity
- [x] Change gfp to either use
stdorrms
TODO:
- [ ] make sure to use correlation and gfp whenever its needed
For now, some test are failing due to hard coded test case working only with correlation (currently using cosine)
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.