-
Notifications
You must be signed in to change notification settings - Fork 381
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
FIX: Insample predictions with series of varying lengths #1246
base: main
Are you sure you want to change the base?
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -37,7 +37,18 @@ | |||
"execution_count": null, | |||
"id": "515672ca", | |||
"metadata": {}, | |||
"outputs": [], | |||
"outputs": [ |
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.
Please clear (not clean) notebooks
@@ -1687,7 +1731,93 @@ | |||
"execution_count": null, | |||
"id": "4bede563-78c0-40ee-ba76-f06f329cd772", | |||
"metadata": {}, | |||
"outputs": [], | |||
"outputs": [ |
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.
clear nb
if test_size > 0 or forefront_offset > 0: | ||
trimmed_dataset = TimeSeriesDataset.trim_dataset( | ||
dataset=self.dataset, right_trim=test_size, left_trim=forefront_offset | ||
for i in range(self.dataset.n_groups): |
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.
So we loop individually over all series?
|
||
# original y | ||
# Combine all series forecasts DataFrames | ||
if isinstance(fcsts_dfs[0], pl_DataFrame): |
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.
Can't we use ufp.concat
here?
" 'val_check_steps': 1,\n", | ||
" 'step_size': 12}\n", | ||
"\n", | ||
"def get_expected_size(df, h, test_size, step_size):\n", |
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.
Difficult to disect but is this the unit test for having insample predictions with series of varying lengths? If not, do we have it?
Currently,
predict_insample()
assumes all series have the same length.This fix allows insample predictions with series of different lengths.