kdgutier / esrnn_torch

MIT License
156 stars 45 forks source link

Return NaN prediction #41

Open ramdhan1989 opened 2 years ago

ramdhan1989 commented 2 years ago

Hi There! I got Nan prediction. I have monthly dataset and would like to forecast 12 steps ahead (1 year). This is my dataset :
image

this is validation that fed into training as well image

this is the model and training :
model = ESRNN(max_epochs=20, freq_of_test=5, batch_size=5, learning_rate=1e-1, per_series_lr_multip=0.8, lr_scheduler_step_size=10, lr_decay=0.1, gradient_clipping_threshold=50, rnn_weight_decay=0.0, level_variability_penalty=100, testing_percentile=10, training_percentile=90, ensemble=True, max_periods=25, seasonality=[], input_size=2, output_size=12,frequency=None, cell_type='LSTM', state_hsize=40, dilations=[[1], [6]], add_nl_layer=False, random_seed=1, device='cpu')

model.fit(training[['unique_id','ds','x']], training[['unique_id','ds','y']],validation[['unique_id','ds','x']],validation[['unique_id','ds','y','y_hat_naive2']],y_hat_benchmark='y_hat_naive2')

I got nan and undetected freq as shown by this during training: image

predict return Nan values: image

sd3093 commented 1 month ago

had the same issue, was due to the ds column not being continuous (i.e. having gaps due to looking at the business days rather than calendar days). maybe that's also related here? do you have any gaps in the ds column?