Skip to content

Commit 4df9215

Browse files
authored
[DOC] Updated documentation on TimeSeriesDataSet.predict_mode (#1720)
### Description Documentation PR. Clarifies use of `predict_mode` for [TimeSeriesDataSet](https://pytorch-forecasting.readthedocs.io/en/stable/api/pytorch_forecasting.data.timeseries.TimeSeriesDataSet.html#). ### Checklist - [x] Linked issues (if existing) - [x] Amended changelog for large changes (and added myself there as contributor) - [x] Added/modified tests - [x] Used pre-commit hooks when committing to ensure that code is compliant with hooks. Install hooks with `pre-commit install`. To run hooks independent of commit, execute `pre-commit run --all-files` Make sure to have fun coding!
1 parent 1747bad commit 4df9215

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pytorch_forecasting/data/timeseries.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,14 @@ def __init__(
323323
distribution.
324324
If True, defaults to (0.2, 0.05), i.e. ~1/4 of samples around minimum encoder length.
325325
Defaults to False otherwise.
326-
predict_mode (bool): if to only iterate over each timeseries once (only the last provided samples).
327-
Effectively, this will take choose for each time series identified by ``group_ids``
326+
predict_mode (bool): If True, the TimeSeriesDataSet will only create one sequence
327+
per time series (i.e. only from the latest provided samples).
328+
Effectively, this will select each time series identified by ``group_ids``
328329
the last ``max_prediction_length`` samples of each time series as
329330
prediction samples and everthing previous up to ``max_encoder_length`` samples as encoder samples.
331+
If False, the TimeSeriesDataSet will create subsequences by sliding a window over the data samples.
332+
For training use cases, it's preferable to set predict_mode=False to get all subseries.
333+
On the other hand, predict_mode = True is ideal for validation cases.
330334
"""
331335
super().__init__()
332336
self.max_encoder_length = max_encoder_length

0 commit comments

Comments
 (0)