Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[timeseries] Add method for plotting forecasts #3889

Merged
merged 6 commits into from
Mar 1, 2024

Conversation

shchur
Copy link
Collaborator

@shchur shchur commented Jan 26, 2024

Description of changes:

  • Add method TimeSeriesPredictor.plot() that can plot time series (potentially, with forecasts) using matplotlib.
  • Update forecasting quickstart tutorial to use the plot method for visualizing forecasts.

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

@shchur shchur added the module: timeseries related to the timeseries module label Jan 26, 2024
@shchur shchur added this to the 1.1 Release milestone Jan 26, 2024
Copy link

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

Copy link

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

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@canerturkmen canerturkmen left a comment

Choose a reason for hiding this comment

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

Very nice! Especially the tests :)

if item_ids is None:
item_ids = list(np.random.choice(data.item_ids, size=min(max_num_item_ids, data.num_items), replace=False))
else:
item_ids = list(item_ids)[:max_num_item_ids]
Copy link
Contributor

Choose a reason for hiding this comment

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

So If I give you 9 item_ids you will not plot the 9th... The item_ids docstring does not spell that out very well, and I would expect this not to be the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated the docstrings to communicate this more clearly.

I have two arguments in favor of keeping the current argument name & effect:

  1. I think that limiting the max number of plots to max_num_item_ids=8 by default is a reasonable safeguard in case the user calls
predictor.plot(data, item_ids=data.item_ids)

which may generate thousands of plots and kill the jupyter kernel.
2. If max_num_item_ids only applies to the case when item_ids=None, we'll need to rename to it something like max_num_random_item_ids or max_num_default_item_ids, which doesn't sound as intuitive as the current name.

@shchur shchur changed the title [after v1.0.1] [timeseries] Add method for plotting forecasts [timeseries] Add method for plotting forecasts Feb 29, 2024
Copy link

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

@shchur shchur merged commit e80b06b into autogluon:master Mar 1, 2024
28 checks passed
@shchur shchur deleted the plot-forecast branch March 1, 2024 08:38
prateekdesai04 pushed a commit to prateekdesai04/autogluon that referenced this pull request Mar 4, 2024
[timeseries] Add method for plotting forecasts (autogluon#3889)

[timeseries] Add support for categorical covariates (autogluon#3874)
ddelange added a commit to ddelange/autogluon that referenced this pull request Mar 21, 2024
…tch-4

* 'master' of https://github.com/awslabs/autogluon: (46 commits)
  [core] move transformers to setup_utils, bump dependency version (autogluon#3984)
  [AutoMM] Fix one lightning upgrade issue (autogluon#3991)
  [CI][Feature] Create a package version table (autogluon#3972)
  [v.1.1][Upgrade] PyTorch 2.1 and CUDA 12.1 upgrade (autogluon#3982)
  [WIP] Code implementation of Conv-LoRA (autogluon#3933)
  [timeseries] Ensure that all metrics handle missing values in the target (autogluon#3966)
  [timeseries] Fix path and device bugs (autogluon#3979)
  [AutoMM]Remove grounding-dino (autogluon#3974)
  [Docs] Update install modules content (autogluon#3976)
  Add note on pd.to_datetime (autogluon#3975)
  [AutoMM] Improve DINO performance (autogluon#3970)
  Minor correction in differ to pick correct environment (autogluon#3968)
  Fix windows python 3.11 issue by removing ray (autogluon#3956)
  [CI][Feature] Package Version Comparator (autogluon#3962)
  [timeseries] Add support for categorical covariates (autogluon#3874)
  [timeseries] Add method for plotting forecasts (autogluon#3889)
  Update conf.py copyright to reflect current year (autogluon#3932)
  [Timeseries][CI]Refactor CI to skip AutoMM and Tabular tests w.r.t timeseries changes (autogluon#3942)
  Fix HPO crash in memory check (autogluon#3931)
  [AutoMM][CI] Capping scikit-learn to avoid HPO test failure (autogluon#3947)
  ...
prateekdesai04 pushed a commit to prateekdesai04/autogluon that referenced this pull request Apr 3, 2024
LennartPurucker pushed a commit to LennartPurucker/autogluon that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: timeseries related to the timeseries module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants