-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] k-nearest neighbors classifier: support for non-brute algorithm…
…s and non-precomputed mode to improve memory efficiency (#5937) This PR adds code to `KNeighborsTimeSeriesClassifier` that passes a callable to the internal sklearn estimator to avoid oom errors when precomputing the distance matrix, trading off memory efficiency with compute efficiency. Adds the following algorithms - with test coverage - to `KNeighborsTimeSeriesClassifier`: * `ball_tree` * `brute_incr` - brute force, but distances are not all precomputed These strategies also allow for unequal length time series given internal adapter encoding. Removes `kd_tree` from the docstring which did not work previously, and cannot be interfaced, as `sklearn` does not allow this to be called together with a custom distance. Potentially fixes #5914, and fixes #2774
- Loading branch information
Showing
2 changed files
with
175 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters