Skip to content

[BUG] Fix arguments dropped or misapplied in the classifier and regressor getters - #550

Merged
MatthewMiddlehurst merged 3 commits into
time-series-machine-learning:mainfrom
MatthewMiddlehurst:mm/getter-fixes
Oct 17, 2026
Merged

MatthewMiddlehurst merged 3 commits into
time-series-machine-learning:mainfrom
MatthewMiddlehurst:mm/getter-fixes

Conversation

@MatthewMiddlehurst

@MatthewMiddlehurst MatthewMiddlehurst commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Follows a review of the estimator getters. The clusterer and forecaster getters are not changed here.

What does this implement/fix? Explain your changes

Fixes names in get_classifier_by_name and get_regressor_by_name which ignore an argument or build something other than the name says.

Getter Names Problem Fix
regressor 1nn-ed, 5nn-ed Built with the KNeighborsTimeSeriesRegressor default distance, which is dtw, so both ran full-window DTW Set distance="euclidean"
regressor 1nn-msm, 5nn-msm kwargs were not passed on. Valid ones were ignored and invalid ones accepted Pass kwargs
regressor all six kNN names n_jobs was not passed on Pass n_jobs
classifier rdst, 1nn-dtw-cv n_jobs was not passed on Pass n_jobs (to GridSearchCV for 1nn-dtw-cv, as grid-svr does)
classifier logistic n_jobs was passed to LogisticRegression, where it has no effect since scikit-learn 1.8 and warns in fit until its removal in 1.10 Stop passing n_jobs
both tsf, rise, cif and their -500 versions, plus classifier stsf, stsf-500 fit_contract was not passed on, so a contract was ignored. drcif already passes it Pass time_limit_in_minutes=fit_contract

Needs careful review:

  • 1nn-ed and 5nn-ed now give different results. Earlier results from get_regressor_by_name under these names are DTW. The TSER archive publication has its own set_tser_exp_regressor.py, which already sets distance="euclidean", so its results are not affected.
  • A contract now applies to the interval forests. With fit_contract above 0 aeon ignores n_estimators and builds until the time limit or contract_max_n_estimators (500), the same as drcif. The default of 0 is unchanged: no contract and n_estimators is used.
  • logistic no longer sets n_jobs on any scikit-learn version. Before 1.8 it only applied to one-vs-rest fits.

Any other comments?

No tests are added. Run locally with Python 3.13.9, aeon 1.6.0 and scikit-learn 1.9.1 (all_extras installed):

  • python -m pytest -n logical tsml_eval/experiments: 67 passed
  • pre-commit run --all-files: passed
  • mypy tsml_eval/: no issues

Contract-capable names left as they are: stc-2hour, where the name sets a transform limit, and regressor tsf-i, where the forest is built per channel inside an ensemble.

… getters

Regressor:
- 1nn-ed and 5nn-ed used the KNeighborsTimeSeriesRegressor default distance,
  which is dtw. Set euclidean.
- 1nn-msm and 5nn-msm did not pass on kwargs.
- Pass n_jobs to the kNN regressors.

Classifier:
- Pass n_jobs to rdst and to the 1nn-dtw-cv grid search.
- Stop passing n_jobs to LogisticRegression, where it has no effect since
  scikit-learn 1.8 and is deprecated.
- drcif-unequal passed n_estimators=500 as well as kwargs, raising TypeError
  when n_estimators was set. Keep 500 as the default and let kwargs change it.
Review feedback: the tests added little, n_estimators stays fixed for
drcif-unequal and the LogisticRegression comment is not needed.
The tsf, rise, cif and stsf names (and their -500 versions) did not pass
fit_contract as time_limit_in_minutes, so a contract was ignored. drcif
already passes it.
@tsml-actions-bot tsml-actions-bot Bot added bug Something isn't working experiments Experiments package labels Oct 17, 2026
@tsml-actions-bot

Copy link
Copy Markdown
Contributor

Thank you for contributing to tsml-eval

I have added the following labels to this PR based on the title: bug.
I have added the following labels to this PR based on the changes made: experiments. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, please run pre-commit locally and push the fixes to your PR branch.

PR CI actions

These checkboxes will add labels to enable or disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Push an empty commit to re-run CI checks

@MatthewMiddlehurst
MatthewMiddlehurst merged commit 322914a into time-series-machine-learning:main Oct 17, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working experiments Experiments package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant