Skip to content

Conversation

canerturkmen
Copy link
Contributor

@canerturkmen canerturkmen commented Apr 28, 2025

Issue #, if available:

Description of changes:

  • Adds ModelRegistry to time series. By default, all models which inherit from AbstractTimeSeriesModel will be registered.
  • Moves default_priority to a field defined by models (WIP).
  • Some typing improvements to presets (refactor WIP).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@canerturkmen canerturkmen added module: timeseries related to the timeseries module code cleanup Fixing warnings/deprecations/syntax/etc. labels Apr 28, 2025
@canerturkmen canerturkmen added this to the 1.4 Release milestone Apr 28, 2025
@canerturkmen canerturkmen requested a review from shchur April 28, 2025 11:31
@@ -244,7 +192,7 @@ def get_preset_models(
f"Keys of the `hyperparameters` dictionary must be strings or types, received {type(model)}."
)

for model_hps in hyperparameters[model]:
for model_hps in hyperparameter_dict[model]:
ag_args = model_hps.pop(constants.AG_ARGS, {})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the PR looks great! I guess we can also move this logic closer to the TimeSeriesTrainer at some point. IMO, there should be just one "preset_configs" file that contains

  • equivalent of the get_default_hps method
  • preset configurations

Everything else feels like it should be a part of the trainer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has already gotten a little big so I'll defer to a fast-follow PR.

@canerturkmen canerturkmen marked this pull request as ready for review August 19, 2025 13:17
Copy link
Collaborator

@shchur shchur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

_aliases = ["Qux"]
pass

class QuxModel(metaclass=ModelRegistry):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use with pytest.raises(...) here to assert that the exception is raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh. I had done this, interesting the branch didn't sync...

"""Abstract base class for all time series models that take historical data as input and
make predictions for the forecast horizon.
"""

default_priority: int = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we align the name of the priority var across tabular and timeseries?

Similarly, should we have ag_name and ag_key? This is what I use for the model registry logic in Tabular.

class CatBoostModel(AbstractModel):
    ag_key = "CAT"
    ag_name = "CatBoost"
    ag_priority = 70

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My answer again to the "should we align?" question is again "not without a compelling reason." Independently, I like ag_priority better so will use that. Analogues for key and name don't exist anyway so won't use those.

Copy link

Job PR-5100-f514314 is done.
Docs are uploaded to http://autogluon-staging.s3-website-us-west-2.amazonaws.com/PR-5100/f514314/index.html

@canerturkmen canerturkmen merged commit ea57de9 into autogluon:master Aug 19, 2025
27 checks passed
@canerturkmen canerturkmen deleted the pyright-presets branch August 19, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Fixing warnings/deprecations/syntax/etc. module: timeseries related to the timeseries module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants