pytorch-forecasting
pytorch-forecasting copied to clipboard
model.predict() should work with a df with just k rows where k = encoder_length
- PyTorch-Forecasting version: 0.10.1
- PyTorch version: 1.11.1
- Python version: 3.8.10
- Operating System: MacOS
Expected behavior
My TimeSeriesDataSet was created via
dataset = TimeSeriesDataSet(
df_all,
group_ids = ['symbol'],
target = 'return', # predict 5-day forward return
time_idx='time_idx',
min_encoder_length=5,
max_encoder_length=5,
min_prediction_length=5,
max_prediction_length=5,
time_varying_unknown_reals=['return'],
scalers=[]
)
My understanding is that this means the model will use the past 5 time steps and predict the next 5 steps. So if we pass in a dataframe (with just one group_id) with 5 rows, predict() should work. But it gives an error, which goes away if I pass in a df with 10 rows (the sum of encoder_len + prediction_len).