Skip to content

Commit 2b46d54

Browse files
chrisholderbaralineMatthewMiddlehurstaeon-actions-bot[bot]kavya-r30
authored
[ENH] KNN n_jobs and updated kneighbours method (#2578)
* added numba prange to all pairwise distances * sfa update * changed warning * thread kneighbors * fix test * custom pairwise threaded * fixed * added threaded decorator * merge changes and fixed call * fix * fix * fixed * expanded threaded decorator to work with classes * fixed * fix * merge * added test for kneighbors * added test for kneighbors * fix * Automated `CONTRIBUTORS.md` update (#2614) Co-authored-by: chrisholder <[email protected]> * Updated Interval Based Notebook (#2620) * [DOC] Added Docstring for regression forecasting (#2564) * Added Docstring for Regression * Added Docstring for Regression * exog fix * GSoC announcement (#2629) * Automated `pre-commit` hook update (#2632) Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Bump tj-actions/changed-files from 45 to 46 in the github-actions group (#2637) * [MNT] Bump tj-actions/changed-files in the github-actions group Bumps the github-actions group with 1 update: [tj-actions/changed-files](https://github.com/tj-actions/changed-files). Updates `tj-actions/changed-files` from 45 to 46 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v45...v46) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * Update pr_precommit.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthew Middlehurst <[email protected]> * [MNT] Update numpy requirement in the python-packages group (#2643) Updates the requirements on [numpy](https://github.com/numpy/numpy) to permit the latest version. Updates `numpy` to 2.2.4 - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.21.0...v2.2.4) --- updated-dependencies: - dependency-name: numpy dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [MNT,DEP] _binary.py metrics deprecated (#2600) * functions deprecated * Empty-Commit * version changed * Support for unequal length timeseries in itakura parallelogram (#2647) * [ENH] Implement DTW with Global alignment (#2565) * Implements Dynamic Time Warping with Global Invariances * Adds Numba JIT compilation support * Adds docs and numba support for dtw_gi and test_distance fixed * Fixes doctests * Automatic `pre-commit` fixes * Minor changes * Minor changes * Remove dtw_gi function and combine with private method _dtw_gi * Adds parameter tests * Fixes doctests * Minor changes * [ENH] Adds kdtw kernel support for kernelkmeans (#2645) * Adds kdtw kernel support for kernelkmeans * Code refactor * Adds tests for kdtw clustering * minor changes * minor changes * [MNT] Skip some excected results tests when numba is disabled (#2639) * skip some numba tests * Empty commit for CI * Update testing_config.py --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Remove REDCOMETs from testing exclusion list (#2630) * remove excluded estimators * redcomets fix * [ENH] Replace `prts` metrics (#2400) * Pre-commit fixes * Position parameter in calculate_bias * Added recall metric * merged into into one file * test added * Changes in test and range_metrics * list of list running but error! * flattening lists, all cases passed * Empty-Commit * changes * Protected functions * Changes in documentation * Changed test cases into seperate functions * test cases added and added range recall * udf_gamma removed from precision * changes * more changes * recommended changes * changes * Added Parameters * removed udf_gamma from precision * Added binary to range * error fixing * test comparing prts and range_metrics * Beta parameter added in fscore * Added udf_gamma function * f-score failing when comparing against prts * fixed f-score output * alpha usage * Empty-Commit * added test case to use range-based input for metrics * soft dependency added * doc update --------- Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Sebastian Schmidl <[email protected]> * Clarify documentation regarding unequal length series limitation (#2589) Co-authored-by: Matthew Middlehurst <[email protected]> * Automated `pre-commit` hook update (#2683) Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Bump tj-actions/changed-files in the github-actions group (#2686) Bumps the github-actions group with 1 update: [tj-actions/changed-files](https://github.com/tj-actions/changed-files). Updates `tj-actions/changed-files` from 46.0.1 to 46.0.3 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v46.0.1...v46.0.3) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [ENH] Set `outlier_norm` default to True for Catch22 estimators (#2659) * sets outlier_norm=True by deafault * Minor changes * Docs improvement * [MNT] Use MacOS for examples/ workflow (#2668) * update bash to 5.x for lastpipe support * added esig installation * install boost before esig * fixed examples path issue for excluded notebooks * switched to fixed version of macos * added signature_method.ipynb to excluded list * removed symlink for /bin/bash * Update dependencies.md (#2717) Correct typo in dependencies.md * Automated `pre-commit` hook update (#2708) Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH] Test Coverage for Pairwise Distance (#2590) * Pairwise distance matrix test * Empty commit for CI --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * re-running notebook for fixing cell output error (#2597) * Docstring (#2609) * [DOC] Add 'Raises' section to docstring #1766 (#2617) * [DOC] Add 'Raises' section to docstring #1766 * Automatic `pre-commit` fixes * Update _base.py * Automatic `pre-commit` fixes --------- Co-authored-by: ayushsingh9720 <[email protected]> * [DOC] Contributor docs update (#2554) * contributing docs update * contributing docs update 2 * typos * Update contributing.md new section * Update testing.md testing update * Update contributing.md dont steal code * Automatic `pre-commit` fixes * Update contributing.md if --------- Co-authored-by: MatthewMiddlehurst <[email protected]> Co-authored-by: Antoine Guillaume <[email protected]> * prevent assignment on PRs (#2703) * Update run_examples.sh (#2701) * [BUG] SevenNumberSummary bugfix and input rename (#2555) * summary bugfix * maintainer * test * readme (#2556) * remove MutilROCKETRegressor from alias mapping (#2623) Co-authored-by: Matthew Middlehurst <[email protected]> * Automated `pre-commit` hook update (#2731) Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Bump the github-actions group with 2 updates (#2733) Bumps the github-actions group with 2 updates: [actions/create-github-app-token](https://github.com/actions/create-github-app-token) and [tj-actions/changed-files](https://github.com/tj-actions/changed-files). Updates `actions/create-github-app-token` from 1 to 2 - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/v1...v2) Updates `tj-actions/changed-files` from 46.0.3 to 46.0.4 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v46.0.3...v46.0.4) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: tj-actions/changed-files dependency-version: 46.0.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixed a few spelling/grammar mistakes on TSC docs examples (#2738) * Fix docstring inconsistencies in benchmarking module (resolves #809) (#2735) * issue#809 Fix docstrings for benchmarking functions * Fixed docstrings in results_loaders.py * Fix docstring inconsistencies in benchmarking module - resolves #809 * Fix docstring inconsistencies in benchmarking module - resolves #809 * [ENH] `best_on_top` addition in `plot_pairwise_scatter` (#2655) * Empty-Commit * best_on_top parameter added * changes * [ENH] Add dummy clusterer tags (#2551) * dummy clusterer tags * len * [ENH] Collection conversion cleanup and `df-list` fix (#2654) * collection conversion cleanup * notebook * fixes --------- Co-authored-by: Tony Bagnall <[email protected]> * [MNT] Updated the release workflows (#2638) * edit release workflows to use trusted publishing * docs * [MNT,ENH] Update to allow Python 3.13 (#2608) * python 3.13 * tensorflow * esig * tensorflow * tensorflow * esig and matrix profile * signature notebook * remove prts * fix * remove annoying deps from all_extras * Update pyproject.toml * [ENH] Hard-Coded Tests for `test_metrics.py` (#2672) * Empty-Commit * hard-coded tests * changes * Changed single ticks to double (#2640) Co-authored-by: Matthew Middlehurst <[email protected]> * 📝 Add HaroonAzamFiza as a contributor for doc (#2740) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * [ENH,MNT] Assign Bot (assigned issues>2) (#2702) * Empty-Commit * point 2 working * changes * changes in comment message * [MNT,ENH] Assign-bot (Allow users to type alternative phrases for assingment) (#2704) * added extra features * added comments * optimized code * optimized code * made changes requested by moderators * fixed conflicts * fixed conflicts * fixed conflicts --------- Co-authored-by: Ramana-Raja <[email protected]> * 📝 Add Ramana-Raja as a contributor for code (#2741) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * Release v1.1.0 (#2696) * v1.1.0 draft * finish * Automated `pre-commit` hook update (#2743) Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Bump the github-actions group with 2 updates (#2744) Bumps the github-actions group with 2 updates: [crs-k/stale-branches](https://github.com/crs-k/stale-branches) and [tj-actions/changed-files](https://github.com/tj-actions/changed-files). Updates `crs-k/stale-branches` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/crs-k/stale-branches/releases) - [Commits](https://github.com/crs-k/stale-branches/compare/v7.0.0...v7.0.1) Updates `tj-actions/changed-files` from 46.0.4 to 46.0.5 - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v46.0.4...v46.0.5) --- updated-dependencies: - dependency-name: crs-k/stale-branches dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: tj-actions/changed-files dependency-version: 46.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [DOC] Add implementation references (#2748) * implementation references * better attribution * use gpu installs for periodic tests (#2747) * Use shape calculation in _fit to optimize QUANTTransformer (#2727) * [REF] Refactor Anomaly Detection Module into Submodules by Algorithm Family (#2694) * Refactor Anomaly Detection Module into Submodules by Algorithm Family * updated documentation and references * implemented suggested changes * minor changes * added headers for remaining algorithm family * removing tree-based header * Automated `pre-commit` hook update (#2756) Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH]Type hints/forecasting (#2737) * Type hints for primitive data types in base module * Type hints for primitive data types and strings in forecating module * type hints for primitives in foreacasting module * Revert "type hints for primitives in foreacasting module" This reverts commit 575122d14b28742140ef1e16a3a351dd5db5072b. * type hints for primitives in forecasting module * Automated `pre-commit` hook update (#2766) Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH] Implement `load_model` function for ensemble classifiers (#2631) * feat: implement `load_model` function for LITETimeClassifier Implement separate `load_model` function for LITETimeClassifier, which takes in `model_path` as list of strings and `classes` and loads all the models separately and stores them in `self.classifiers_` * feat: implement `load_model` function for InceptionTimeClassifier Implement separate `load_model` function for InceptionTimeClassifier, which takes in `model_path` as list of strings and `classes` and loads all the models separately and stores them in `self.classifiers_` * fix: typo in load model function * feat: convert load_model functions to classmethods * test: implement test for save load for LITETIME and Inception classification models * Automatic `pre-commit` fixes * refactor: move loading tests to separate files * Update _ae_abgru.py (#2771) * Automated `pre-commit` hook update (#2779) Co-authored-by: MatthewMiddlehurst <[email protected]> * [DOC] Fix Broken [Source] Link and Improve Documentation for suppress_output() (#2677) * Fix Broken [Source] Link and Improve Documentation for suppress_output() Function * modified docstring and added tests * modified docstring example * modifying docstring examples * modifying docstring examples * updating conf file * updated docstring * base transform tidy (#2773) * DOC: Add Raises section for invalid weights in KNeighborsTimeSeriesClassifier (#1766) (#2764) Document the ValueError raised during initialization when an unsupported value is passed to the 'weights' parameter. Clarifies expected exceptions for users and improves API documentation consistency. Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] Fixes Issue Improve `_check_params` method in `kmeans.py` and `kmedoids.py` (#2682) * Improves _check_params * removes function and adds a var * minor changes * minor changes * minor changes * line endings to LF * use variable instead of duplicating strings * weird file change * weird file change --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] Add type hints for deep learning regression classes (#2644) * type hints for cnn for regrssion * editing import modules Model & Optim * type hints for disjoint_cnn for regrssion * FIX type hints _get_test_params * ENH Change linie of importing typing * type hints for _encoder for regrssion * type hints for _fcn for regrssion * type hints for _inception_time for regrssion * type hints for _lite_time for regrssion * type hints for _mlp for regrssion * type hints for _resnet for regrssion * type hints for _base for regrssion * FIX: mypy errors in _disjoint_cnn.py file * FIX: mypy typing errors * Fix: Delete variable types, back old-verbose * FIX: add model._save in save_last_model_to_file function * FIX: Put TYPE_CHECKING downside * Fix: Put Any at the top * [DOC] Add RotationForest Classifier Notebook for Time Series Classification (#2592) * Add RotationForest Classifier Notebook for Time Series Classification * Added references and modified doc * minor modifications to notebook description * Update rotation_forest.ipynb --------- Co-authored-by: Matthew Middlehurst <[email protected]> * fix: Codeowners for benchmarking metrics AD (#2784) * [GOV] Supporting Developer role (#2775) * supporting dev role * pr req * Update governance.md * typo * Automatic `pre-commit` fixes * aeon --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT, ENH, DOC] Rework similarity search (#2473) * WIP remake module structure * Update _brute_force.py * Update test__commons.py * WIP mock and test * Add test for base subsequence * Fix subsequence_search tests * debug brute force mp * more debug of subsequence tests * more debug of subsequence tests * Add functional LSH neighbors * add notebook for sim search tasks * Updated series similarity search * Fix mistake addition in transformers and fix base classes * Fix registry and api reference * Update documentation and fix some leftover bugs * Update documentation and add default test params * Fix identifiers and test data shape for all_estimators tests * Fix missing params * Fix n_jobs params and tags, add some docs * Fix numba test bug and update testing data for sim search * Fix imports, testing data tests, and impose predict/_predict interface to all sim search estimators * Fix args * Fix extract test * update docs api and notebooks * remove notes * Patrick comments * Adress comments and clean index code * Fix Patrick comments * Fix variable suppression mistake * Divide base class into task specific * Fix typo in imports * Empty commit for CI * Fix typo again * Add check_inheritance exception for similarity search * Revert back to non per type base classes * Factor check index and typo in test --------- Co-authored-by: Patrick Schäfer <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: baraline <[email protected]> * [ENH] Adapt the DCNN Networks to use Weight Norm Wrappers (#2628) * adapt the dcnn networks to use weight norm wrappers and remove l2 regularization * Automatic `pre-commit` fixes * add custom object * Automatic `pre-commit` fixes * fix trial --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [GOV] Remove inactive developers (#2776) * inactive devs * logo fix * Automated `pre-commit` hook update (#2792) Co-authored-by: MatthewMiddlehurst <[email protected]> * Add SomtoOnyekwelu to .all-contributorsrc (#2788) * Automated `CONTRIBUTORS.md` update (#2794) Co-authored-by: MatthewMiddlehurst <[email protected]> * [BUG] Fix a bug in ClaSP Series Transformer when using floatXX as Input (where XX != 64) (#2774) * Automatic conversion to float64. * remove print * [DOC] Changed SummaryClusterer's summary_stat from "percentiles" to "quantiles" (#2778) * changed summary_stats * changed summary_stats * changed summary_stats * changed summary_stats for regression and classification * [ENH] Test coverage for AEAttentionBiGRUNetwork Improved (#2540) * test file for ae_abgru added * soft depedency of tf resolved * aeabgru test file changed, bug resolved * aeabgru file reverted to original state * [BUG] Better error message for Rotation Forest with no usable attributes (#2798) * better error message for rotf failure * Update _rotation_forest_classifier.py * Update _rotation_forest_regressor.py * [DOC] Inconsistent double ticks in segmentation package, public docstring only (#2622) * double ticks EAggloSegmenter docstring * double ticks HMMSegmenter docstring * double ticks InformationGainSegmenter docstring * double ticks for other EAggloSegmenter docstring and removed extra whitespace --------- Co-authored-by: Matthew Middlehurst <[email protected]> * put lower bound keras (#2808) * [REF] Refactor smoothing transformers into a sub-package (#2783) * mockup * init * decorator * correct import and tag * base docs * wrappers * tests * docs and imports * test params * register * big refactor * smoothing refactor * ad stuff * fixes * fixes * no longer required * [ENH] Refactor range-based metrics to restore original behavior (#2781) * feat: refactor range-based metrics to be consistent with the other AD metrics and integrate them into the AD test harness * refactor: move new range metrics methods into their old place and remove the deprecation * refactor: factor out test execution from test fixtures * refactor: move tests to new methods * fix: copy'n'paste error * [ENH]Use n_jobs parameter in KNeighborsTimeSeriesClassifier. (#2687) * Use n_jobs parameter in KNeighborsTimeSeriesClassifier. * Don't convert proba dtype. * Remove is_fitted checks, update docstring. * Implement parallel backend param. * Correct keyword argument for Parallel. * Add check_n_jobs. --------- Co-authored-by: stijn <[email protected]> * [ENH] add informational tags back to estimator docs (#2652) * feat: add new tags information for anomaly detection * feat: add tag information in given anomaly modles * fix: add new anomaly detector tags in mock anomaly detector class * fix: use anomaly-detector instead of estimator for new tags * update and add basic testing * fixes --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [DOC] Documentation improvement of BaseSeriesEstimator and BaseAeonEstimator (#2612) * Added the docs for base series and base classes * Updated documentation for base classes --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] HydraTransformer Output changed (#2656) * output type added * hydra wflow modified * hydra test file added * pr_pytest reverted * soft dep check added * soft dep corrected * docstring corrected, enhanced test cases * [DOC] Improved Hidalgo Segmentation Notebook (#2616) * Improved Hidalgo Segmentation Notebook * Updated hidalgo notebook --------- Co-authored-by: Matthew Middlehurst <[email protected]> * new devs and workflow consolidation (#2797) * all branches (#2809) * Automated `pre-commit` hook update (#2820) Co-authored-by: TonyBagnall <[email protected]> * [MNT] Bump crs-k/stale-branches in the github-actions group (#2821) Bumps the github-actions group with 1 update: [crs-k/stale-branches](https://github.com/crs-k/stale-branches). Updates `crs-k/stale-branches` from 7.0.1 to 8.1.1 - [Release notes](https://github.com/crs-k/stale-branches/releases) - [Commits](https://github.com/crs-k/stale-branches/compare/v7.0.1...v8.1.1) --- updated-dependencies: - dependency-name: crs-k/stale-branches dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: indexing in kdtw (#2826) * [ENH] Added test cases for feature based clustering (#2690) * Added test cases for feature based clustering * Automatic `pre-commit` fixes * added docstring * Automatic `pre-commit` fixes * added . * added . * updated tsfresh * Automatic `pre-commit` fixes * added pytest _check_soft_dependencies for tsfresh * Automatic `pre-commit` fixes * added more testing * Automatic `pre-commit` fixes * added docs * added docs * added pytest * Automatic `pre-commit` fixes * improved docs * Automatic `pre-commit` fixes * improved test cases * changes made as requested by moderators * changes made as requested by moderators * Automatic `pre-commit` fixes * changed "percentiles" to "quantiles" --------- Co-authored-by: Ramana-Raja <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> * [DOC] Fix inconsistent double backticks in updated similarity_search module docstrings (#2618) * [ENH] Update `_continuous.py` functions (#2822) * update continuous, has test failure * parameters back to original * alpha added into precision * removes p_alpha deprecation * changes * [MNT] stop segmenters changing state in predict (#2526) * remove stored variables in predict * IGTS * GGS * FLUSS * FLUSS * CLASP * CLASP * revert clasp * revert clasp * revert clasp * Update testing_config.py * Update _fluss.py * refactor dummy to naive (#2831) * [ENH] add a difference transformer to series transformations (#2729) * add difference transformer to series transformations * add myself to .all-contributorsrc * small modification * modify according to reviews * [ENH] add informational tags back to estimator docs (#2652) * feat: add new tags information for anomaly detection * feat: add tag information in given anomaly modles * fix: add new anomaly detector tags in mock anomaly detector class * fix: use anomaly-detector instead of estimator for new tags * update and add basic testing * fixes --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [DOC] Documentation improvement of BaseSeriesEstimator and BaseAeonEstimator (#2612) * Added the docs for base series and base classes * Updated documentation for base classes --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] HydraTransformer Output changed (#2656) * output type added * hydra wflow modified * hydra test file added * pr_pytest reverted * soft dep check added * soft dep corrected * docstring corrected, enhanced test cases * [DOC] Improved Hidalgo Segmentation Notebook (#2616) * Improved Hidalgo Segmentation Notebook * Updated hidalgo notebook --------- Co-authored-by: Matthew Middlehurst <[email protected]> * new devs and workflow consolidation (#2797) * all branches (#2809) * Automated `pre-commit` hook update (#2820) Co-authored-by: TonyBagnall <[email protected]> * [MNT] Bump crs-k/stale-branches in the github-actions group (#2821) Bumps the github-actions group with 1 update: [crs-k/stale-branches](https://github.com/crs-k/stale-branches). Updates `crs-k/stale-branches` from 7.0.1 to 8.1.1 - [Release notes](https://github.com/crs-k/stale-branches/releases) - [Commits](https://github.com/crs-k/stale-branches/compare/v7.0.1...v8.1.1) --- updated-dependencies: - dependency-name: crs-k/stale-branches dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: indexing in kdtw (#2826) * [ENH] Added test cases for feature based clustering (#2690) * Added test cases for feature based clustering * Automatic `pre-commit` fixes * added docstring * Automatic `pre-commit` fixes * added . * added . * updated tsfresh * Automatic `pre-commit` fixes * added pytest _check_soft_dependencies for tsfresh * Automatic `pre-commit` fixes * added more testing * Automatic `pre-commit` fixes * added docs * added docs * added pytest * Automatic `pre-commit` fixes * improved docs * Automatic `pre-commit` fixes * improved test cases * changes made as requested by moderators * changes made as requested by moderators * Automatic `pre-commit` fixes * changed "percentiles" to "quantiles" --------- Co-authored-by: Ramana-Raja <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> * [DOC] Fix inconsistent double backticks in updated similarity_search module docstrings (#2618) * delete some descriptions * modification to _maintainer_ --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: Adarsh Dubey <[email protected]> Co-authored-by: Kevin Shah <[email protected]> Co-authored-by: Balgopal Moharana <[email protected]> Co-authored-by: Kavya Rambhia <[email protected]> Co-authored-by: aeon-actions-bot[bot] <148872591+aeon-actions-bot[bot]@users.noreply.github.com> Co-authored-by: TonyBagnall <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sebastian Schmidl <[email protected]> Co-authored-by: Ramana Raja <[email protected]> Co-authored-by: Ramana-Raja <[email protected]> Co-authored-by: Ciph3r <[email protected]> * Automated `CONTRIBUTORS.md` update (#2832) Co-authored-by: MatthewMiddlehurst <[email protected]> * [BUG] Fix data loader (#2810) * Update _data_loaders.py * Update _data_loaders.py * stop deleting directories * Automated `pre-commit` hook update (#2841) Co-authored-by: TonyBagnall <[email protected]> * 📝 Add lucifer4073 as a contributor for code (#2846) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * [BUG] Adds test case for using csr_matrix with pickle - invalidates #2210 (#2843) * Extend test parameter set to validate if csx_matrix works with pickle. * Invalidates bug #2210 * [DOC] Docstring improved for dummy regressor (#2839) * Docstring improved for dummy regressor * convo resolved * remove numba typing (#2858) * [DOC] Regression forecaster docstring (#2837) * docstring * docstring * [ENH] Whole-series anomaly detection (#2326) * mockup * init * decorator * correct import and tag * base docs * wrappers * tests * docs and imports * test params * register * big refactor * smoothing refactor * Revert "smoothing refactor" This reverts commit c245ccbd0c1481b188a9094ccd7ff493613a89cd. * fixes * final bits and docs for refactor * fixes * testing fixes * Update aeon/anomaly_detection/collection/base.py Co-authored-by: Sebastian Schmidl <[email protected]> * Update docs/api_reference/anomaly_detection.rst Co-authored-by: Sebastian Schmidl <[email protected]> * Review changes * docs * import --------- Co-authored-by: Sebastian Schmidl <[email protected]> * [MNT] Bump the github-actions group across 1 directory with 2 updates (#2868) Bumps the github-actions group with 2 updates in the / directory: [ossf/scorecard-action](https://github.com/ossf/scorecard-action) and [crs-k/stale-branches](https://github.com/crs-k/stale-branches). Updates `ossf/scorecard-action` from 2.4.1 to 2.4.2 - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](https://github.com/ossf/scorecard-action/compare/v2.4.1...v2.4.2) Updates `crs-k/stale-branches` from 8.1.1 to 8.2.0 - [Release notes](https://github.com/crs-k/stale-branches/releases) - [Commits](https://github.com/crs-k/stale-branches/compare/v8.1.1...v8.2.0) --- updated-dependencies: - dependency-name: ossf/scorecard-action dependency-version: 2.4.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: crs-k/stale-branches dependency-version: 8.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Automated `pre-commit` hook update (#2867) Co-authored-by: TonyBagnall <[email protected]> * [ENH] introduce revised version of ETS (#2834) * first version for correctness testing * timing * examples * new tests * refactor predict * final ETS * arima first * docstrings * docstrings * Convert error, trend and seasonality types to strings * Automatic `pre-commit` fixes * Add Type hints back in * Fix Type hints * Fix Linting issue * Automatic `pre-commit` fixes * Update test_ets to use strings for error, trend and seasonality types * Automatic `pre-commit` fixes * switch to fastmath * remove _arima, incorrectly introduced here * all int or str parameters * refactor variable name --------- Co-authored-by: alexbanwell1 <[email protected]> * [DOC] Update the projects lists (#2146) * remove Theta * projects * draft * add some papers * update papers * update projects * remove completed projects * remove poorly specified/out of date projects * remove merlin projects * restructure papers by year * papers using aeon * projects list and previous projects * update papers --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [DEP] Remove `prts` dependency (#2863) * remove prts from pyproject * docs * Update _continuous.py * Automatic `pre-commit` fixes --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH] Starting Self Supervised Model with first example (#2385) * add ssl module in transformations collection * add api * add test params * fix example * restart tests * test fix params * network none * revert * import inside function * try dummy * test repr * network repr * enhance testing * fix test * replace tcnn by lite * tony's comments * fix typing * fix znorm * z_norm in test * add exp module * Update repr.py * Update base.py * Automatic `pre-commit` fixes --------- Co-authored-by: MatthewMiddlehurst <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> * update slack link (#2877) * [BUG] Switch results loaders from http to https (#2883) * https * https in tests * [ENH] Correct broken source links for `set_params` and `get_params` in Aeon estimator docs (#2754) * Correct broken source links for `set_params` and `get_params` in Aeon estimator docs * made necessary changes * made necessary changes * modified linkcode_resolve * added comments * open PR comment changes (#2878) * [ENH] Implemented Tracking differentiator-based multiview dilated characteristics (TD-MVDC) Classifier (#2535) * Files and structure of tdmvdc class added * utility functions for tdmvdc applied * unecessary files removed * Initial implementation of TDMVDC added * accuracy improved to the required 81 per cent * test params added for tdmvdc * n_jobs temporarily disabled * n_jobs test params removed * Revert "n_jobs test params removed" This reverts commit 91539099f3cd3a201b7fe68bfea80a9ae5ebc706. * multithreading capability temporarily removed from tdmvdc * multithreading added * n_jobs removed from test_param * test added for tdmvdc * test added for tdmvdc * optimized comments * Made tdmvdc uniform across all feauture based classifiers * tdmvdc tested * check constructor test exlcuded for tdmvdc * changed * init file changed * check constructor corrected tdmvdc --------- Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> * Automated `pre-commit` hook update (#2888) Co-authored-by: TonyBagnall <[email protected]> * [MNT] Update pandas requirement in the python-packages group (#2889) Updates the requirements on [pandas](https://github.com/pandas-dev/pandas) to permit the latest version. Updates `pandas` to 2.3.0 - [Release notes](https://github.com/pandas-dev/pandas/releases) - [Commits](https://github.com/pandas-dev/pandas/compare/v2.0.0...v2.3.0) --- updated-dependencies: - dependency-name: pandas dependency-version: 2.3.0 dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [MNT] Drop Python 3.9 (#2845) * drop python 3.9 * fixes * readme * tag * test skip * [ENH] Series transformer pipeline and datatype list tidy (#2830) * series pipeline * fixes and docs * test fix * fix * [ENH] Multivariate and unequal PF, speed-ups and distance classifier tidy (#2872) * pass 1 * pf change fixes and derivative function merge * test * fixes * expected result * unequal and deprecations * [ENH] Add two forecasting tags (#2882) * add tags * correct exog * typo * [DOC] A fix to inconsistent double tick quote for the classification.distance_based module (#2627) * A fix to inconsistent double quotes * A fix to inconsistent double quotes * A fix to inconsistent double quotes * A fix to inconsistent double quotes * Revert "A fix to inconsistent double quotes" This reverts commit ff98c81a6c29b61d053e66c80f9f167b718172f5. * A fix to inconsistent double quotes * A fix to inconsistent double quotes * fix inconsistent double ticks * Automatic `pre-commit` fixes * Update _elastic_ensemble.py * Update _proximity_forest.py --------- Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> * 📝 Add Ahmed-Zahran02 as a contributor for doc (#2892) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * [BUG] Forecasting regressor fix and notebook (#2885) * stop returning an array * notebook * Create window.png * fix test and typo * remove unfinished sentence * 📝 Add AnaghDeshpande as a contributor for doc (#2896) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * [GOV] Use the NumFOCUS code of conduct and rename `aeon` workgroup (#2852) * code of conduct update and readmes * typo --------- Co-authored-by: Sebastian Schmidl <[email protected]> * [DOC] resolved the inconsistency of double ticks for the anomaly detection module #809 (#2546) * resolved the inconsistency of double quotes * resolved the inconsistency of double ticks * resolved the pre-commit errors occuring due to flake8 * Update _cblof.py made changes in line number 19 and 145. * Automatic `pre-commit` fixes * Update _copod.py made changes in line number 76 * Automatic `pre-commit` fixes * Update _iforest.py made changes in line number 19 * Automatic `pre-commit` fixes * Update _kmeans.py made changes in line number 178 * Automatic `pre-commit` fixes * Update _merlin.py made changes in line number 215 * Automatic `pre-commit` fixes * Update _one_class_svm.py made changes in line number 19 * Automatic `pre-commit` fixes * Update _pyodadapter.py made changes in line number 165 * Update _stomp.py made changes in line number 125 * Automatic `pre-commit` fixes * converted directives to single ticks * added double ticks to code ref * fixed link in cblof.py and some other minor changes * Update base.py --------- Co-authored-by: Patrick Schäfer <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] Forecasting testing (#2891) * call forecasting checks * basic cleanup * fix * add assert error messages * remove fit_is_empty check (see #2893) * remove extra argument to fit * remove extra argument to predict * correct forecast argument * Update _yield_forecasting_checks.py * add test for predict --------- Co-authored-by: Tony Bagnall <[email protected]> * [MNT] Fixing CI issues and separate doctests from regular CI runners (#2902) * trying to fix CI stuff * use numba in codecov * try cov * no cov * doctest-plus * doctest-plus * addopts * dedicated doctest test * periodic * [BUG] Fixes a bug with SFAFast throwing an error when calling transform after fit (#2897) * Bugfix for SFA_Fast with transform called after fit * [MNT] Bump stefanzweifel/git-auto-commit-action from 5 to 6 in the github-actions group (#2906) * [MNT] Bump stefanzweifel/git-auto-commit-action Bumps the github-actions group with 1 update: [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action). Updates `stefanzweifel/git-auto-commit-action` from 5 to 6 - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5...v6) --- updated-dependencies: - dependency-name: stefanzweifel/git-auto-commit-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> * Update issue_comment_edited.yml * Update pr_precommit.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthew Middlehurst <[email protected]> * [ENH] Added RNN in networks (#2875) * RNN net architecture added * Fixed activation function for both str and list * RNN test mesage corrected * reverted workflow * reverted workflow * requested changes applied * convo resolved * Update README.md (#2908) * [ENH] Add recursive and direct methods to forecasting base class (#2899) * base class methods * direct * recursive * base * direct_forecasting * recursive_forecasting * recursive_forecasting * recursive_forecasting * direct notebook * direct notebook * direct notebook * switch to iterative * switch to iterative * iterative * iterative notebook * append change * append change * fix regression bug * comment * [ENH] remove horizon from ETS constructor, parametrize ETS tests (#2898) * remove horizon from ETS argument, parametrize tests * remove horizon from example * docstring * [ENH] Refactor example dataset for unequal length univariate (#2859) * deprecate PLAID * add pickup * deprecated * [ENH, REF]Refactored time-point based ROCKAD implementation (#2804) * mockup * init * decorator * correct import and tag * base docs * wrappers * tests * docs and imports * test params * register * big refactor * smoothing refactor * Revert "smoothing refactor" This reverts commit c245ccbd0c1481b188a9094ccd7ff493613a89cd. * fixes * final bits and docs for refactor * move predict_proba logic into inner_predict for code consistency * Added reference and example code, updated description * Adapted tests to be semi-supervised * Added semi-supervised labeling to description * moved Attributes above References and Examples, updated path of collection based rockad implementation * merge 2 * CI errors * maintainer * doctest --------- Co-authored-by: MatthewMiddlehurst <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH] enhance naive forecaster with new strategies (#2869) * naive forecaster with new strategies * few modifications according to reviews * made modifications and add documentation * modifications according to reviews * try to pass the test * delete one comment * modify 1)more test cases for seasonal_last 2)raise exception for y input in _predict, and related documentation * fix typo * take y * Update _naive.py --------- Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> * [ENH,REF] Unequal length collection transforms (#2903) * move and update unequal transforms * unequal transforms * comment * better sorting * extra transform test * changes for review * Release v1.2.0 (#2912) * release prep * changelog * Automated `pre-commit` hook update (#2914) Co-authored-by: TonyBagnall <[email protected]> * [MNT] Comments on numba caching and release CI fix (#2916) * release CI jank * comment * swap * [ENH] Improves `create_multi_comparison_matrix` parameters and saving (#2657) * Empty-Commit * condensed parameters and showing output * test cases updated * changes * updated examples * point 2 working * [DOC] Clarify comments regarding issue assignment limits and user notifications * condensed parameters and showing output * test cases updated * changes * dir -> save_path * Reverted _mcm.py and its test to match main * requested changes done, pdf not showing yet * changes * changes * updated docstring * changes * requested changes * example file changes * changed formats default to None --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [MNT] Prevents assignment on Restricted Labels (#2706) * restricted labels * set * resolve conflicts * merge assign PRs and small change --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] Update scikit-learn requirement from <1.7.0,>=1.0.0 to >=1.0.0,<1.8.0 in the python-packages group (#2907) * [MNT] Update scikit-learn requirement in the python-packages group Updates the requirements on [scikit-learn](https://github.com/scikit-learn/scikit-learn) to permit the latest version. Updates `scikit-learn` to 1.7.0 - [Release notes](https://github.com/scikit-learn/scikit-learn/releases) - [Commits](https://github.com/scikit-learn/scikit-learn/compare/1.0...1.7.0) --- updated-dependencies: - dependency-name: scikit-learn dependency-version: 1.7.0 dependency-type: direct:production dependency-group: python-packages ... Signed-off-by: dependabot[bot] <[email protected]> * new validation * Update test_rockad.py * Update _rockad.py --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: MatthewMiddlehurst <[email protected]> * [MNT] issue-assign-bot - only users with write access should be able to assign others (#2739) * only admins can assign others * improve comment message * Automatic `pre-commit` fixes * fixes according to latest code * Automatic `pre-commit` fixes * changes according to latest code * resolve merge conflicts * Automatic `pre-commit` fixes * adjust according to latest code * merge --------- Co-authored-by: Matthew Middlehurst <[email protected]> * [MNT] Created workflow for closing "AI Spam" pull requests (#2750) * added ai_spam * Automatic `pre-commit` fixes * fixed comment text * fixed comment text * updated to python 3.11 --------- Co-authored-by: Ramana-Raja <[email protected]> * [ENH] Use `np.argpartition` for efficient top-k selection instead of `np.argsort` (#2805) * use argpartition for efficient selection instead of argsort * made the required changes * [EHN] Allow exogenous variables in regression forecasters (#2915) * add exogenous variable feature to base and regression forecasters * delete self._check_X for exog --------- Co-authored-by: Tony Bagnall <[email protected]> * Automated `pre-commit` hook update (#2922) Co-authored-by: TonyBagnall <[email protected]> * [MNT] Bump actions/create-github-app-token in the github-actions group (#2923) Bumps the github-actions group with 1 update: [actions/create-github-app-token](https://github.com/actions/create-github-app-token). Updates `actions/create-github-app-token` from 1 to 2 - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/v1...v2) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-version: '2' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [ENH] Added RecurrentRegressor for time series regression (#2894) * RNN net architecture added * Fixed activation function for both str and list * RNN test mesage corrected * RNN regressor added * init updated w rnn * reverted workflow * reverted workflow * requested changes applied * updated with latest recurrent network * merged with main * [MNT] Add testing workflow for multithreading and make threaded estimators use `check_n_jobs` (#2913) * multithreading test * njons and workflow fix * tde and base test * _n_jobs in testing * _n_jobs in testing * more test fixes * fixes * more n_jobs * more n_jobs * more n_jobs * more n_jobs * more n_jobs * test fix * test fix * test fix * test fix * hopefully last * hopefully last again * dont enumerate * periodic test * [DOC,MNT] Documentation configuration clean-up (#2911) * start * remove old parameter * numpydoc config * conf tidy * headers * exclude unused methods and update gsoc in about * changelog * binder button * myst config * remove extra bullet point * changelog * Automatic `pre-commit` fixes --------- Co-authored-by: MatthewMiddlehurst <[email protected]> * [DOC] fix incorrect references of classes in getting started page (#2762) * fix: incorrect references of classes in getting started page * fix: typo in BaseSimilaritySearch --------- Co-authored-by: Matthew Middlehurst <[email protected]> * Automated `pre-commit` hook update (#2932) Co-authored-by: TonyBagnall <[email protected]> * [DOC] Add RecurrentRegressor and RecurrentNetowork to api_reference (#2935) * Recurrent Regressor added to API doc * Recurrent network added to API doc * [ENH] Refactor to set forecast_ in fit and to require y in predict (#2927) * require y in predict * forecast_ * remove calls to predict * doc examples * regression forecaster rework * other tests * docstrings * refactor forecasting checks * test * test * regression notebook * test_ets * Revert "test_ets" This reverts commit 827a12a0a2fa3fec2d55d481a97aed62bd290059. * Revert "regression notebook" This reverts commit 27978022921c8c436d1ae458511ce5885d425c09. * ets * notebook * naive testing * [ENH] Clone estimator in direct forecast (#2936) * clone estimator * clone estimator * tests * test update * [ENH] Implement Time-Varying Parameter (TVP) regression forecaster using Kalman filter (#2920) * TVP * bug * refactor * test * test * add notebook * docstring * add an intercept * includes * squeeze predict * format * remove incomplete example * add test params * dummy test * dummy test * clone estimator * clone estimator * remove y is none * notebook * tests * tests * test update * remove pointless test * docstring update * [MNT] Add codespell support (config, workflow to detect/not fix) and make it fix a "few" typos (#2653) * Add github action to codespell main on push and PRs * Add rudimentary codespell config * Add pre-commit definition for codespell * Some skips for codespell -- lots of work todo * [DATALAD RUNCMD] run codespell throughout fixing typos automagically (but ignoring overall fail due to ambigous ones) === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * codespeed notebook and testing * incorrect typos and notebooks * more typos * config and fixes * Update similarity_search.ipynb fix notebook typos * update skip * temp typo and annotation workflow * annotations * fix typos --------- Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: Antoine Guillaume <[email protected]> * typo (#2944) * correct checkout (#2945) * DOC: fix typos in MatrixProfileSeriesTransformer (#2940) (#2941) Co-authored-by: Tony Bagnall <[email protected]> * 📝 Add CodeFor2001 as a contributor for doc (#2946) * 📝 Update CONTRIBUTORS.md [skip ci] * 📝 Update .all-contributorsrc [skip ci] --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> * [ENH] Rework ETS Forecaster (#2939) * iterative * iterative ETS * notebook * Fix bug in seasonality calculation * Add example for ETS iterative forecasting * ets tests * holding notebook * example * Run Itertive notebook --------- Co-authored-by: Alex Banwell <[email protected]> * [MNT] add n_jobs parameter for sax invertion (#2953) * add n_jobs * add tag * Automated `pre-commit` hook update (#2949) Co-authored-by: TonyBagnall <[email protected]> * [DEP] Deprecate PLAID dataset (#2928) * remove PLAID * remove PLAID * [DOC] Classification notebook links (#2942) * fix links * fix links --------- Co-authored-by: Antoine Guillaume <[email protected]> * [ENH] Added TemporalConvolutionalNetwork in aeon/networks (#2933) * tcn network added * tcn_net pytest added * tcn_network updated with default params * tcn reshaped * tcn changed * tcn updated * doctest corrected * tcn rshaped * workflow corrected * [BUG] Improve signature docs (#2929) * signature docs * tests * typo * notebook * correct image * fix test * decalre in init * switch classifier to store SignatureTransformer * revert classifier * revert transformer * embed image rather than link * equation * equation * remove tests * maths * maths * add eq * add eq * remove example * line break --------- Co-authored-by: Antoine Guillaume <[email protected]> * [MNT] Workflow maintenance (#2919) * keep running doctests on fail * renames * remove 3.13.5 * [ENH] Add Basic ARIMA model (#2860) * arima first * move utils * make functions private * Modularise SARIMA model * Add ARIMA forecaster to forecasting package * Add example to ARIMA forecaster, this also tests the forecaster is producing the expected results * Basic ARIMA model * Convert ARIMA to numba version * Adjust parameters to allow modification in fit * Update example and return native python type * Fix examples for tests * Fix Nelder-Mead Optimisation Algorithm Example * Fix Nelder-Mead Optimisation Algorithm Example #2 * Remove Nelder-Mead Example due to issues with numba caching functions * Fix return type issue * Address PR Feedback * Ignore small tolerances in floating point value in output of example * Fix kpss_test example * Fix kpss_test example #2 * Update documentation for ARIMAForecaster, change constant_term to be bool, and fix bug with it not operating on differemced data * Modify ARIMA to allow predicting multiple values by updating the state without refitting the model * Fix bug using self.d rather than self.d_ * refactor ARIMA * docstring * find forecast_ in fit * remove optional y * add iterative * typo * typo * calculate forecast_ * use differenced * example * iterative * arima tests * revert to float * switch nelder_mead version * isolate loss function * isolate loss function * remove the utils version of nelder mead * set self.c_ correctly * numba optimise * numba optimise * numba optimise * Add missing _extract_paras file * initial residuals bug and proper differencing d>1 * loss function ignores zeroed start points * fix test * revert FLOAT_CMP * refactor into forecasting * remove example --------- Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: Alex Banwell <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> * Automated `pre-commit` hook update (#2959) Co-authored-by: TonyBagnall <[email protected]> * clean space for swap CI to stop sporadic failue (#2965) * [MNT] Bump crs-k/stale-branches in the github-actions group (#2950) --- updated-dependencies: - dependency-name: crs-k/stale-branches dependency-version: 8.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [ENH] New experimental module: imbalance in collection transformers (#2498) * first draft * [ENH] wrapper for smote and adasyn of the imbalance module in collection transformers (#2501) * smote & adasyn in aeon.transformation.imbalance * smote & adasyn in aeon.transformation.imbalance * smote & adasyn in aeon.transformation.imbalance * smote & adasyn in aeon.transformation.imbalance * make experimental * inherit from SMOTE * test equivalence to imblearn * move tests * format * import * add test parameters * Ported OHIT (#2573) * Automatic `pre-commit` fixes * docstrings * remove import * remove incorrect test parameters * docstrings * examples * examples * refactor variable name * format comments and reference * typos --------- Co-authored-by: Chuanhang Qiu <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> * stop overwriting y (#2969) * [BUG] Fix redcomets bug when using only one sample (#2952) * Fix * fix exemples * Empty commit for CI * Rework examples and add test * Try fixing example indentation error * Fix examples --------- Co-authored-by: baraline <[email protected]> Co-authored-by: Patrick Schäfer <[email protected]> * [DEP] Remove deprecated transforms (#2961) * remove depcated transforms * fixes * updated dtw gi * debug * debug * debug * debug * fix * refactored regressor * removed file * added test for knn regressor kneighbors * fixed sklearn compatiability tests * cleaned up and commented kneighbors function * fixed when list passed * added public and private methods for kneigbors and additionally expanded testing with comments * removed threaded decorator and swapped to private method --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Antoine Guillaume <[email protected]> Co-authored-by: Matthew Middlehurst <[email protected]> Co-authored-by: aeon-actions-bot[bot] <148872591+aeon-actions-bot[bot]@users.noreply.github.com> Co-authored-by: chrisholder <[email protected]> Co-authored-by: Kavya Rambhia <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aryan Pola <[email protected]> Co-authored-by: Tanish Yelgoe <[email protected]> Co-authored-by: Sebastian Schmidl <[email protected]> Co-authored-by: Kaustubh <[email protected]> Co-authored-by: Akash Kawle <[email protected]> Co-authored-by: TinaJin0228 <[email protected]> Co-authored-by: Ayush Singh <[email protected]> Co-authored-by: ayushsingh9720 <[email protected]> Co-authored-by: HaroonAzamFiza <[email protected]> Co-authored-by: adityagh006 <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: V_26@ <[email protected]> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Ramana Raja <[email protected]> Co-authored-by: Ramana-Raja <[email protected]> Co-authored-by: Ahmed Zahran <[email protected]> Co-authored-by: Adarsh Dubey <[email protected]> Co-authored-by: Ali El Hadi ISMAIL FAWAZ <[email protected]> Co-authored-by: Somto Onyekwelu <[email protected]> Co-authored-by: Saad Al-Tohamy <[email protected]> Co-authored-by: Patrick Schäfer <[email protected]> Co-authored-by: baraline <[email protected]> Co-authored-by: Aadya Chinubhai <[email protected]> Co-authored-by: Balgopal Moharana <[email protected]> Co-authored-by: Massimiliano <[email protected]> Co-authored-by: steenrotsman <[email protected]> Co-authored-by: stijn <[email protected]> Co-authored-by: Kevin Shah <[email protected]> Co-authored-by: TonyBagnall <[email protected]> Co-authored-by: alexbanwell1 <[email protected]> Co-authored-by: Anagh.B.Deshpande <[email protected]> Co-authored-by: Tony Bagnall <[email protected]> Co-authored-by: Patrick <[email protected]> Co-authored-by: MatthewMiddlehurst <[email protected]> Co-authored-by: Yaroslav Halchenko <[email protected]> Co-authored-by: Saniya S Inamdar <[email protected]> Co-authored-by: Alex Banwell <[email protected]> Co-authored-by: Chuanhang Qiu <[email protected]>
1 parent 67b8c3d commit 2b46d54

File tree

4 files changed

+402
-122
lines changed

4 files changed

+402
-122
lines changed

aeon/classification/distance_based/_time_series_neighbors.py

Lines changed: 143 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
distances in aeon.distances.
66
"""
77

8+
import numbers
9+
from typing import Optional
10+
811
__maintainer__ = []
912
__all__ = ["KNeighborsTimeSeriesClassifier"]
1013

11-
from typing import Callable, Optional, Union
14+
from typing import Callable, Union
1215

1316
import numpy as np
14-
from joblib import Parallel, delayed
1517

1618
from aeon.classification.base import BaseClassifier
17-
from aeon.distances import get_distance_function
19+
from aeon.distances import pairwise_distance
1820
from aeon.utils.validation import check_n_jobs
1921

2022
WEIGHTS_SUPPORTED = ["uniform", "distance"]
@@ -47,21 +49,17 @@ class KNeighborsTimeSeriesClassifier(BaseClassifier):
4749
n_timepoints)` as input and returns a ``float``.
4850
distance_params : dict, default = None
4951
Dictionary for metric parameters for the case that distance is a ``str``.
50-
n_jobs : int, default = 1
51-
The number of parallel jobs to run for neighbors search.
52-
``None`` means 1 unless in a :obj:``joblib.parallel_backend`` context.
53-
``-1`` means using all processors.
54-
parallel_backend : str, ParallelBackendBase instance or None, default=None
55-
Specify the parallelisation backend implementation in joblib, if None
56-
a ‘prefer’ value of “threads” is used by default. Valid options are
57-
“loky”, “multiprocessing”, “threading” or a custom backend.
58-
See the joblib Parallel documentation for more details.
52+
n_jobs : int, default=1
53+
The number of jobs to run in parallel. If -1, then the number of jobs is set
54+
to the number of CPU cores. If 1, then the function is executed in a single
55+
thread. If greater than 1, then the function is executed in parallel.
5956
6057
Raises
6158
------
6259
ValueError
6360
If ``weights`` is not among the supported values.
6461
See the ``weights`` parameter description for valid options.
62+
Dictionary for metric parameters for the case that distance is a str.
6563
6664
Examples
6765
--------
@@ -90,13 +88,11 @@ def __init__(
9088
n_neighbors: int = 1,
9189
weights: Union[str, Callable] = "uniform",
9290
n_jobs: int = 1,
93-
parallel_backend: str = None,
9491
) -> None:
9592
self.distance = distance
9693
self.distance_params = distance_params
9794
self.n_neighbors = n_neighbors
9895
self.n_jobs = n_jobs
99-
self.parallel_backend = parallel_backend
10096

10197
self._distance_params = distance_params
10298
if self._distance_params is None:
@@ -124,7 +120,6 @@ def _fit(self, X, y):
124120
y : array-like, shape = (n_cases)
125121
The class labels.
126122
"""
127-
self.metric_ = get_distance_function(method=self.distance)
128123
self.X_ = X
129124
_, self.y_ = np.unique(y, return_inverse=True)
130125
self._n_jobs = check_n_jobs(self.n_jobs)
@@ -148,10 +143,26 @@ def _predict_proba(self, X):
148143
The class probabilities of the input samples. Classes are ordered
149144
by lexicographic order.
150145
"""
151-
preds = Parallel(n_jobs=self._n_jobs, backend=self.parallel_backend)(
152-
delayed(self._proba_row)(x) for x in X
153-
)
154-
return np.array(preds)
146+
preds = np.zeros((len(X), len(self.classes_)))
147+
for i in range(len(X)):
148+
neigh_dist, neigh_ind = self.kneighbors(X[i : i + 1])
149+
neigh_dist = neigh_dist[0]
150+
neigh_ind = neigh_ind[0]
151+
152+
if self.weights == "distance":
153+
weights = 1 / (neigh_dist + np.finfo(float).eps)
154+
elif self.weights == "uniform":
155+
weights = np.repeat(1.0, len(neigh_ind))
156+
else:
157+
raise Exception(f"Invalid kNN weights: {self.weights}")
158+
159+
for id, w in zip(neigh_ind, weights):
160+
predicted_class = self.y_[id]
161+
preds[i, predicted_class] += w
162+
163+
preds[i] = preds[i] / np.sum(preds[i])
164+
165+
return preds
155166

156167
def _predict(self, X):
157168
"""
@@ -170,70 +181,136 @@ def _predict(self, X):
170181
y : array of shape (n_cases)
171182
Class labels for each data sample.
172183
"""
173-
preds = Parallel(n_jobs=self._n_jobs, backend=self.parallel_backend)(
174-
delayed(self._predict_row)(x) for x in X
184+
self._check_is_fitted()
185+
186+
neigh_ind = self._kneighbors(
187+
X, n_neighbors=1, return_distance=False, query_is_train=False
175188
)
176-
return np.array(preds, dtype=self.classes_.dtype)
189+
indexes = neigh_ind[:, 0]
190+
return self.classes_[self.y_[indexes]]
177191

178-
def _proba_row(self, x):
179-
scores = self._predict_scores(x)
180-
return scores / np.sum(scores)
192+
def kneighbors(self, X=None, n_neighbors=None, return_distance=True):
193+
"""Find the K-neighbors of a point.
181194
182-
def _predict_row(self, x):
183-
scores = self._predict_scores(x)
184-
return self.classes_[np.argmax(scores)]
195+
Returns indices of and distances to the neighbors of each point.
185196
186-
def _predict_scores(self, x):
187-
scores = np.zeros(len(self.classes_))
188-
idx, weights = self._kneighbors(x)
189-
for id, weight in zip(idx, weights):
190-
predicted_class = self.y_[id]
191-
scores[predicted_class] += weight
192-
return scores
197+
Parameters
198+
----------
199+
X : 3D np.ndarray of shape = (n_cases, n_channels, n_timepoints) or list of
200+
shape [n_cases] of 2D arrays shape (n_channels,n_timepoints_i)
201+
The query point or points.
202+
If not provided, neighbors of each indexed point are returned.
203+
In this case, the query point is not considered its own neighbor.
204+
n_neighbors : int, default=None
205+
Number of neighbors required for each sample. The default is the value
206+
passed to the constructor.
207+
return_distance : bool, default=True
208+
Whether or not to return the distances.
193209
194-
def _kneighbors(self, X):
210+
Returns
211+
-------
212+
neigh_dist : ndarray of shape (n_queries, n_neighbors)
213+
Array representing the distances to points, only present if
214+
return_distance=True.
215+
neigh_ind : ndarray of shape (n_queries, n_neighbors)
216+
Indices of the nearest points in the population matrix.
195217
"""
196-
Find the K-neighbors of a point.
218+
self._check_is_fitted()
219+
220+
# Input validation
221+
if n_neighbors is None:
222+
n_neighbors = self.n_neighbors
223+
elif not isinstance(n_neighbors, numbers.Integral):
224+
raise TypeError(
225+
f"n_neighbors does not take {type(n_neighbors)} value, enter integer "
226+
f"value"
227+
)
228+
elif n_neighbors <= 0:
229+
raise ValueError(f"Expected n_neighbors > 0. Got {n_neighbors}")
230+
231+
if not isinstance(return_distance, bool):
232+
raise TypeError(
233+
f"return_distance must be a boolean, got {type(return_distance)}"
234+
)
235+
236+
# Preprocess X if provided
237+
query_is_train = X is None
238+
if query_is_train:
239+
X = self.X_
240+
else:
241+
X = self._preprocess_collection(X, store_metadata=False)
242+
self._check_shape(X)
243+
244+
# Validate n_neighbors against data size
245+
n_samples_fit = len(self.X_)
246+
if query_is_train:
247+
if not (n_neighbors < n_samples_fit):
248+
raise ValueError(
249+
"Expected n_neighbors < n_samples_fit, but "
250+
f"n_neighbors = {n_neighbors}, n_samples_fit = {n_samples_fit}, "
251+
f"n_samples = {len(X)}"
252+
)
253+
else:
254+
if not (n_neighbors <= n_samples_fit):
255+
raise ValueError(
256+
"Expected n_neighbors <= n_samples_fit, but "
257+
f"n_neighbors = {n_neighbors}, n_samples_fit = {n_samples_fit}, "
258+
f"n_samples = {len(X)}"
259+
)
197260

198-
Returns indices and weights of each point.
261+
return self._kneighbors(X, n_neighbors, return_distance, query_is_train)
262+
263+
def _kneighbors(self, X, n_neighbors, return_distance, query_is_train):
264+
"""Find the K-neighbors of a point.
265+
266+
Returns indices of and distances to the neighbors of each point.
199267
200268
Parameters
201269
----------
202-
X : np.ndarray
203-
A single time series instance if shape = ``(n_channels, n_timepoints)``
270+
X : 3D np.ndarray of shape = (n_cases, n_channels, n_timepoints) or list of
271+
shape [n_cases] of 2D arrays shape (n_channels,n_timepoints_i)
272+
The query point or points.
273+
n_neighbors : int
274+
Number of neighbors required for each sample.
275+
return_distance : bool
276+
Whether or not to return the distances.
277+
query_is_train : bool
278+
Whether the query points are from the training set.
204279
205280
Returns
206281
-------
207-
ind : array
282+
neigh_dist : ndarray of shape (n_queries, n_neighbors)
283+
Array representing the distances to points, only present if
284+
return_distance=True.
285+
neigh_ind : ndarray of shape (n_queries, n_neighbors)
208286
Indices of the nearest points in the population matrix.
209-
ws : array
210-
Array representing the weights of each neighbor.
211287
"""
212-
distances = np.array(
213-
[
214-
self.metric_(X, self.X_[j], **self._distance_params)
215-
for j in range(len(self.X_))
216-
]
288+
distances = pairwise_distance(
289+
X,
290+
None if query_is_train else self.X_,
291+
method=self.distance,
292+
n_jobs=self.n_jobs,
293+
**self._distance_params,
217294
)
218295

219-
# Find indices of k nearest neighbors using partitioning:
220-
# [0..k-1], [k], [k+1..n-1]
221-
# They might not be ordered within themselves,
222-
# but it is not necessary and partitioning is
223-
# O(n) while sorting is O(nlogn)
224-
closest_idx = np.argpartition(distances, self.n_neighbors)
225-
closest_idx = closest_idx[: self.n_neighbors]
226-
227-
if self.weights == "distance":
228-
ws = distances[closest_idx]
229-
# Using epsilon ~= 0 to avoid division by zero
230-
ws = 1 / (ws + np.finfo(float).eps)
231-
elif self.weights == "uniform":
232-
ws = np.repeat(1.0, self.n_neighbors)
233-
else:
234-
raise Exception(f"Invalid kNN weights: {self.weights}")
235-
236-
return closest_idx, ws
296+
# If querying the training set, exclude self by setting diag to +inf
297+
if query_is_train:
298+
np.fill_diagonal(distances, np.inf)
299+
300+
k = n_neighbors
301+
# 1) partial select smallest k
302+
idx_part = np.argpartition(distances, kth=k - 1, axis=1)[:, :k]
303+
# 2) sort those k by (distance, index)
304+
row_idx = np.arange(distances.shape[0])[:, None]
305+
part_d = distances[row_idx, idx_part]
306+
# argsort by distance, then by index for ties (lexsort uses last key as primary)
307+
order = np.lexsort((idx_part, part_d), axis=1)
308+
neigh_ind = idx_part[row_idx, order]
309+
310+
if return_distance:
311+
neigh_dist = distances[row_idx, neigh_ind]
312+
return neigh_dist, neigh_ind
313+
return neigh_ind
237314

238315
@classmethod
239316
def _get_test_params(

aeon/classification/distance_based/tests/test_time_series_neighbors.py

Lines changed: 61 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for KNeighborsTimeSeriesClassifier."""
22

3+
import numpy as np
34
import pytest
45

56
from aeon.classification.distance_based import KNeighborsTimeSeriesClassifier
@@ -42,12 +43,9 @@
4243
@pytest.mark.parametrize("distance_key", distance_functions)
4344
def test_knn_on_unit_test(distance_key):
4445
"""Test function for elastic knn, to be reinstated soon."""
45-
# load arrowhead data for unit tests
4646
X_train, y_train = load_unit_test(split="train")
4747
X_test, y_test = load_unit_test(split="test")
48-
knn = KNeighborsTimeSeriesClassifier(
49-
distance=distance_key,
50-
)
48+
knn = KNeighborsTimeSeriesClassifier(distance=distance_key)
5149
knn.fit(X_train, y_train)
5250
pred = knn.predict(X_test)
5351
correct = 0
@@ -77,3 +75,62 @@ def test_knn_bounding_matrix(distance_key):
7775
if pred[j] == y_test[j]:
7876
correct = correct + 1
7977
assert correct == expected_correct_window[distance_key]
78+
79+
80+
@pytest.mark.parametrize("distance_key", distance_functions)
81+
def test_knn_kneighbors(distance_key):
82+
"""Test knn kneighbors with comprehensive validation."""
83+
X_train, y_train = load_unit_test(split="train")
84+
X_test, y_test = load_unit_test(split="test")
85+
86+
knn = KNeighborsTimeSeriesClassifier(distance=distance_key)
87+
knn.fit(X_train, y_train)
88+
89+
# Test basic kneighbors functionality
90+
dists, ind = knn.kneighbors(X_test, n_neighbors=3)
91+
assert isinstance(dists, np.ndarray)
92+
assert isinstance(ind, np.ndarray)
93+
assert dists.shape == (X_test.shape[0], 3)
94+
assert ind.shape == (X_test.shape[0], 3)
95+
96+
# Test that distances are non-negative
97+
assert np.all(dists >= 0)
98+
99+
# Test that indices are within valid range
100+
assert np.all(ind >= 0)
101+
assert np.all(ind < len(X_train))
102+
103+
# Test that distances are sorted (closest first)
104+
assert np.all(dists[:, 0] <= dists[:, 1])
105+
assert np.all(dists[:, 1] <= dists[:, 2])
106+
107+
# Test using kneighbors results to make predictions manually
108+
# This validates that the kneighbors method returns correct neighbor indices
109+
indexes = ind[:, 0]
110+
classes, y = np.unique(y_train, return_inverse=True)
111+
pred = classes[y[indexes]]
112+
correct = 0
113+
for j in range(0, len(pred)):
114+
if pred[j] == y_test[j]:
115+
correct = correct + 1
116+
assert correct == expected_correct_window[distance_key]
117+
118+
# Test kneighbors with different n_neighbors values
119+
dists_2, ind_2 = knn.kneighbors(X_test, n_neighbors=2)
120+
assert dists_2.shape == (X_test.shape[0], 2)
121+
assert ind_2.shape == (X_test.shape[0], 2)
122+
123+
# Test kneighbors without returning distances
124+
ind_only = knn.kneighbors(X_test, n_neighbors=3, return_distance=False)
125+
assert isinstance(ind_only, np.ndarray)
126+
assert ind_only.shape == (X_test.shape[0], 3)
127+
# Should return same indices as when return_distance=True
128+
np.testing.assert_array_equal(ind_only, ind)
129+
130+
# Test kneighbors on training data (should exclude self)
131+
train_dists, train_ind = knn.kneighbors(n_neighbors=2)
132+
assert train_dists.shape == (len(X_train), 2)
133+
assert train_ind.shape == (len(X_train), 2)
134+
# Each point should not be its own neighbor (diagonal should be excluded)
135+
for i in range(len(X_train)):
136+
assert i not in train_ind[i]

0 commit comments

Comments
 (0)