forked from tinkoff-ai/etna
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update ProphetModel
to handle external timestamp
#203
Merged
Merged
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7037e9d
fix: update ProphetModel to handle external timestamp, update inferen…
d-a-bunin 205830c
Merge remote-tracking branch 'origin/unaligned-data' into issue-186
d-a-bunin e4bf946
fix: fix inference tests after merge
d-a-bunin 20bdbf9
chore: update changelog
d-a-bunin 00a2c34
fix: fix prophet doctest
d-a-bunin 7337903
docs: update docs for prophet model
d-a-bunin 61401f0
Merge remote-tracking branch 'origin/unaligned-data' into issue-186
d-a-bunin 8e03c56
fix: fix after merge
d-a-bunin 33206b8
Merge remote-tracking branch 'origin/unaligned-data' into issue-186
d-a-bunin a3164ed
fix: fix after merge
d-a-bunin a87986b
fix: remove duplication of fixtures
d-a-bunin 57a17da
fix: fix formatting
d-a-bunin File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we don't add this code to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now, it seems specific for inference tests. I'll think about moving it higher. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import pandas as pd | ||
import pytest | ||
|
||
from etna.datasets import TSDataset | ||
from etna.datasets import generate_ar_df | ||
|
||
|
||
@pytest.fixture | ||
def ts_with_external_timestamp() -> TSDataset: | ||
df = generate_ar_df(periods=100, start_time=10, n_segments=2, freq=None) | ||
df_wide = TSDataset.to_dataset(df) | ||
df_exog = generate_ar_df(periods=100, start_time=10, n_segments=2, freq=None) | ||
df_exog["target"] = pd.date_range(start="2020-01-01", periods=100).tolist() * 2 | ||
df_exog_wide = TSDataset.to_dataset(df_exog) | ||
df_exog_wide.rename(columns={"target": "external_timestamp"}, level="feature", inplace=True) | ||
ts = TSDataset(df=df_wide.iloc[:-10], df_exog=df_exog_wide, known_future="all", freq=None) | ||
return ts |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't check that frequency is always the same. For example, it works fine if we have one frequency for train and for test. In theory, prophet can work fine even if there no regular frequency, but I'm not sure should we support this case or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably infer frequency during train, for example, and check if it is as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should check the freq and give a warning if the freq for the train is different from the freq for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like the idea of warning. It will be thrown in every per-segment model, which seems too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a bad idea to have different frequencies, so the only option is to fail in this situation.