pytorch-forecasting icon indicating copy to clipboard operation
pytorch-forecasting copied to clipboard

Hello everyone, please after training my model how can I fit it to accept a dataset without target column when I want to predict new values. The fact is that in Real life we do not know yet the value we seeking by prediction process

Open daniwxcode opened this issue 3 years ago • 6 comments

daniwxcode avatar May 28 '22 00:05 daniwxcode

Does this help you? https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/stallion.html#Predict-on-new-data

DominikPKaiser avatar May 29 '22 17:05 DominikPKaiser

Does this help you? https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/stallion.html#Predict-on-new-data

No I think I have not well expressed my problem. When I try to do model.predict(df) and df does not contain the target, I get an error. In predict mode, it shouldn't care if the "target" is present or not, so it's unclear if I'm doing something wrong, or if it's expected behavior.

daniwxcode avatar May 29 '22 22:05 daniwxcode

Well I see, I also got an error when I delete the target column, but in my case the target is used as an input variable for the past values. I think this behavior is expected as the target is expected in the dataset parameters of the model.

model.dataset_parameters

I do not know how to adjust this but a simple way to workaround is might that you just add the target column containing zeros for the values you do not know yet.

DominikPKaiser avatar May 30 '22 08:05 DominikPKaiser

I have the same problem. In binary classification it is even less frequent than past target is used as predictor

partiallycomplex avatar May 31 '22 09:05 partiallycomplex

Well I see, I also got an error when I delete the target column, but in my case the target is used as an input variable for the past values. I think this behavior is expected as the target is expected in the dataset parameters of the model.

model.dataset_parameters

I do not know how to adjust this but a simple way to workaround is might that you just add the target column containing zeros for the values you do not know yet.

setting target to zero is impacting the forecast. The question is, does pytorch only use past data to predict values? to be usable in a real word the target column should not be needed when we want to predict.

daniwxcode avatar Jun 03 '22 10:06 daniwxcode

Well I see, I also got an error when I delete the target column, but in my case the target is used as an input variable for the past values. I think this behavior is expected as the target is expected in the dataset parameters of the model. model.dataset_parameters I do not know how to adjust this but a simple way to workaround is might that you just add the target column containing zeros for the values you do not know yet.

setting target to zero is impacting the forecast. The question is, does pytorch only use past data to predict values? to be usable in a real word the target column should not be needed when we want to predict.

Why not create a new target value for the new column and set it to be NaN?

babaniyi avatar Jun 10 '22 11:06 babaniyi