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] Automatically convert timestamps to datetime & handle DataFrame inputs #2606

Merged
merged 9 commits into from
Jan 3, 2023

Conversation

shchur
Copy link
Collaborator

@shchur shchur commented Dec 27, 2022

Description of changes:

This PR contains several potential improvements to the data loading process in autogluon.timeseries:

  1. Automatically convert the timestamp columns to the datetime64 format when constructing a TimeSeriesDataFrame from pd.DataFrame without multiindex.
  2. Load a TimeSeriesDataFrame from path (local or remote), similar to autogluon.tabular.TabularDataset.
  3. Accept pd.DataFrame as input to TimeSeriesPredictor and automatically convert to TimeSeriesDataFrame under the hood.

These changes make it possible to significantly shorten the code for training AGTS on a dataset.

  • Current minimal example
import pandas as pd
from autogluon.timeseries import TimeSeriesPredictor, TimeSeriesDataFrame

raw_df = pd.read_csv(
    "https://autogluon.s3.amazonaws.com/datasets/timeseries/dummy/dummy.csv", 
    parse_dates=["timestamp"],
)
data = TimeSeriesDataFrame(raw_df)
predictor = TimeSeriesPredictor().fit(data)
  • Using Option 2 from this PR
from autogluon.timeseries import TimeSeriesPredictor, TimeSeriesDataFrame

data = TimeSeriesDataFrame("https://autogluon.s3.amazonaws.com/datasets/timeseries/dummy/dummy.csv")
predictor = TimeSeriesPredictor().fit(data)
  • Using Option 3 from this PR
import pandas as pd
from autogluon.timeseries import TimeSeriesPredictor

data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/timeseries/dummy/dummy.csv")
predictor = TimeSeriesPredictor().fit(data)

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

@github-actions
Copy link

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

@github-actions
Copy link

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

@github-actions
Copy link

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

@shchur shchur changed the title [timeseries] [WIP] Automatically convert timestamps to datetime & handle DataFrame inputs [timeseries] Automatically convert timestamps to datetime & handle DataFrame inputs Jan 2, 2023
@github-actions
Copy link

github-actions bot commented Jan 2, 2023

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

@github-actions
Copy link

github-actions bot commented Jan 2, 2023

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

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.

LGTM!

@shchur shchur merged commit 5edce07 into autogluon:master Jan 3, 2023
@shchur shchur deleted the improve-data-loader branch January 3, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants