sktime / sktime/pytorch-forecasting

Demand forecasting TFT example - from_dataset() choice of data

Open
#656 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5k
Forks
912
Avg merge
3d 13h
Merged PRs (30d)
12

Description

I was hoping someone could clear up the use of from_dataset() in the demand forecasting example using TFT.

training = TimeSeriesDataSet(
    data[lambda x: x.date < training_cutoff],
    time_idx= ...,
    target= ...,
    # weight="weight",
    group_ids=[ ... ],
    max_encode_length=max_encode_length,
    max_prediction_length=max_prediction_length,
    static_categoricals=[ ... ],
    static_reals=[ ... ],
    time_varying_known_categoricals=[ ... ],
    time_varying_known_reals=[ ... ],
    time_varying_unknown_categoricals=[ ... ],
    time_varying_unknown_reals=[ ... ],
)

validation = TimeSeriesDataSet.from_dataset(training, data, min_prediction_idx=training.index.time.max() + 1, stop_randomization=True)

When creating the validation set using from_dataset() isn't it using the whole dataset that is used to create the training dataset and therefore leaking data into the validation set? Shouldn't the data used by the data after the training_cutoff be like sodata[lambda x: x.date > training_cutoff]?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the demand forecasting TFT example and the TimeSeriesDataSet.from_dataset() entry point first. Check how the training cutoff, full data argument, and min_prediction_idx interact, then determine whether the example leaks validation data and whether the example or its explanation needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
data, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.