Doubts in Demand Forecasting using TFT
See original GitHub issueHello I am really thankful for the work that you have put in for pytorch-forecasting. In the demand forecasting using TFT example:
for idx in range(10): # plot 10 examples
best_tft.plot_prediction(new_x, new_raw_predictions, idx=idx, show_future_observed=False);
I am not sure what these 10 examples are from, are they for different batch sizes?- In the Actuals vs Prediction:
Checking how the model performs across different slices of the data allows us to detect weaknesses. Plotted below are the means of predictions vs actuals across each variable divided into 100 bins using the Now, we can directly predict on the generated data using the calculate_prediction_actual_by_variable() and plot_prediction_actual_by_variable() methods. The gray bars denote the frequency of the variable by bin, i.e. are a histogram. Does this mean to say that we are trying to tell how much these individual variables help in prediction?
-
new_raw_predictions, new_x = best_tft.predict(new_prediction_data, mode="raw", return_x=True)
What is difference between mode=“raw” and mode=“prediction”>? -
Also I checked the values in val_dataloader using
x,y in iter(dataloader)
. Here thex['decoder_target']
has the target values that we want to predict already present. So: - in case of training this is being used for teacher forcing, right? - also when using predicting on val_dataloader will this part be still used or it will be ignored. (Is mode=‘prediction’ during.predict(...)
has some role to play in ensuring this doesn’t gets used orvalidation.to_dataloader(train=False, batch_size=batch_size * 10, num_workers=0)
does this?
Thank you.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
First of all: Great to hear you like the package! Let me try to answer your questions:
These are just the first 10 examples. If from the training dataset, they will be random selections.
No, you this helps to understand in variable ranges, the model struggles to make good predictions. The importance of variables for prediction is another analysis.
"raw"
is about the raw output of the network which contains predictions, target scales, etc. while"prediction"
is just prediction of the target valuesIt is actually not necessary for teacher-forcing but mostly for plotting.