[timeseries] Improve model-zoo hyperparameter typing - #5605
Open
PsychoRover wants to merge 2 commits into
Open
PsychoRover wants to merge 2 commits into
PsychoRover wants to merge 2 commits into
Conversation
- Guard gluonts and autogluon.common imports behind TYPE_CHECKING - Use public API import path for TimeSeriesHyperparameters in predictor - Add re-exports in hyperparameters/__init__.py and timeseries/__init__.py - Add from __future__ import annotations consistently across type files - Use PEP 585 list[] instead of List[] in deep_models.py - Remove redundant union members in NPTSModel (float|SearchableFloat -> SearchableFloat) - Allow list-of-dicts (ModelType | list[ModelType]) for all model entries - Widen model_name from Literal to str | space.Categorical in TabularModelMixIn - Drop NJobsMixIn from PerStepTabularModel to avoid TypedDict invariance error - Fix docstring URLs to use literal strings instead of uninterpolated variables
PsychoRover
force-pushed
the
devx/hyperparameters-types
branch
from
April 18, 2026 18:38
dae7c56 to
a7f2bfe
Compare
Contributor
|
Job PR-5605-a7f2bfe is done. |
Collaborator
|
Hi @PsychoRover, thanks a lot for the PR - this looks like a really cool idea. I will need to think about the design a bit and see how to best integrate this with existing mechanisms that we have like the I cannot promise that I will complete this by the next release, but this definitely looks like a great quality-of-life improvement that we should eventually merge. |
Collaborator
|
I created an issue to keep track of this #5698 |
Author
|
Hi @shchur! Glad you liked it. LMK if I can help somehow 👍 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR improves the typing surface for
TimeSeriesPredictor.fit(..., hyperparameters=...)by adding and refining model-specific type definitions for the Time Series model zoo.Motivation
This came out of a great AutoGluon experience in an academic forecasting competition a friend and I worked on.
We finished 8th overall (and not 1st 😄), so if anything was missing, it was definitely our “personal skills” and not AutoGluon.
While working, we found ourselves constantly going back and forth between docs and source to confirm accepted hyperparameters. This PR is meant to make that loop easier for future users through stronger, clearer type hints.
What Changed
TimeSeriesPredictor.fit.Validation
py_compile+ import checks).Notes
Demo
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.