Repository navigation
Conversation
The first row and column of the ERP cost matrix held the total distance to g of the whole series instead of the cumulative cost of the leading points, so aligning after a prefix of gaps was over-charged and results disagreed with the recursive ERP definition (103 of 200 random pairs).
Thank you for contributing to
|
TonyBagnall
left a comment
There was a problem hiding this comment.
good find, @sohailshk this must have been here for a long time! You will have to rebase #4037 after this goes in
|
The failing checks are limited to Windows 3.11 and 3.13. |
yeah made an issue for it #4056 |
|
need to tresolve the conflict though |
Reference Issues/PRs
Fixes #4003
What does this implement/fix? Explain your changes.
The first row and column of the ERP cost matrix held the total of
|x_k - g|over the whole series. In ERP (Chen and Ng, 2004)D[i, 0]is the cost of deleting the firstipoints, i.e. the cumulative sum. Alignments that start with a run of gaps were over-charged, soerp_distance,erp_pairwise_distance,erp_cost_matrixanderp_alignment_pathdisagreed with the recursive definition (103 of 200 random pairs in the new test) and the triangle inequality failed.The boundary now uses the cumulative sum in the cost matrix and in both rolling-row versions.
test_erp.pygains a comparison against the recursive definition (univariate, multichannel, arrayg) and the example from the issue. The expected ERP values intest_distance_correctness.pychange (102.0979 becomes 101.448661 for two of the three entries).Run on current
main,pytest aeon/distances/elastic/tests/test_erp.py aeon/distances/elastic/tests/test_distance_correctness.py -k erp: 2 failed without the change, 18 passed with it.Does your contribution introduce a new dependency? If yes, which one?
No.
The implementation and tests were written with AI assistance.