pytorch-forecasting
pytorch-forecasting copied to clipboard
Help on possible overfit
PyTorch-Forecasting version: current master branch PyTorch version: 1.9.0 Python version: 3.8
Hi, I'm using 1 year hourly data to train. Just a single target and time (and another const column as group_id). I use
data['time_idx'] = (data['hourly'] - pd.Timestamp("1970-01-01")) // pd.Timedelta("1h")
data["time_idx"] -= data["time_idx"].min()
The data is basically 6000~9000, almost no trend, and no seasonality. I use last 14 days to predict next 3 days (viz. 72 hours as it is hourly data). I use lr=3E-4 or 3E-5 and hidden_size=500. After hundreds of epochs, the training loss can be less than 20, but validation loss might be 90~160. If I checked the trained data, it is pretty good and the predict on trained data is like:
mean loss is just less than 2% and max is 4~6%. I will be super happy if predict on new can be like this, but for new data it is like (darkblue is predict):
or (darkblue is predict)
the mean loss is around 4~5%, not too bad, but the max loss is 10~13%. More importantly, seems for different days, the predict pattern is very similar. If I use moving window to use 14 days to predict next 3 days, each time the predicted sequence has very similar changing pattern (as the last 2 screenshots). For new data, the predicted values seems missing some 'details'.
Is there something I can do to make the predict on new behave closer like on trained data?
Thanks