[MNT, ENH, DOC] Rework similarity search #2473
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #2341, #2236, #2028, #2020, #1806
What does this implement/fix? Explain your changes.
The previous structure for similarity search was not in line with the structure we would expect considering other aeon modules, the lack of distinct base classes for some tasks, as well as the initial design choice (due to the lack of practical experience with using and expanding the module) lead to some really complex code when working on #2341 to make everything work together. Further expanding the module would have made thing worse.
To make the module more flexible and comprehensible, the following rework is proposed in this PR (AEP to be updated acordingly):
find_neighbors
andfind_motifs
for all type for similarity search estimatorsSeriesSearch
andSubsequencesSearch
. TheSubsequencesSearch
focuses on tasks for which the goal is to find motifs or neighbors in subsequences of time series (e.g. Matrix Profiles, Motiflets, etc.). theSeriesSearch
focuses on task using whole series (e.g. Indexes such as LSH, iSAX, etc.)k
,threshold
andinverse_distance
parameters to customise search outputsBaseMatrixProfile
, and STOMP, where most existing code was ported)Does your contribution introduce a new dependency? If yes, which one?
No.
Any other comments?
As this is still a WIP, I would love some inputs on the structure (notably from @patrickzib !) to make the module more future-proof to future additions and easier to use.
TODO list :
SubsequenceSearch
partBaseIndexSearch
SeriesSearch
base class and estimators