I am trying to implement the following idea.
I was following the code sample from TensorFlow.
I will be glad if you suggest to me how can I modify the WindowGenerator() function or implement the idea.
Much appreciated.
I am trying to implement the following idea.
I was following the code sample from TensorFlow.
I will be glad if you suggest to me how can I modify the WindowGenerator() function or implement the idea.
Much appreciated.
@Md_Saifur_Rahman Welcome to tensorflow Forum!
Sure @Md_Saifur_Rahman , I’d be happy to help you implement your idea of adding predicted values for specific variables (except one) to your LSTM training data using WindowGenerator() in TensorFlow.
Do you want to try below approaches : -
You haven’t specified the model used for generating the predictions. This affects how you integrate predictions into your LSTM input.
Clarify whether predictions are made daily, hourly, etc., as this determines how to align predictions with LSTM window inputs.
Consider potential causal relationships between variables to avoid introducing circular dependencies and bias.
Apporches that could be useful in this case :
Prepare Target Variable and Predictions: - Ensure your target variable and associated predictions have the same temporal resolution (e.g., daily if predictions are daily). Filter out the one variable you want to exclude from predictions.
Create a custom subclass of WindowGenerator
that inherits its functionality.Override the __getitem__
method to create training batches. Within __getitem__
, combine the actual values of relevant variables with the predicted values for the predicted day.
Instantiate Custom WindowGenerator
: - Create an instance of your custom WindowGenerator
with appropriate parameters. Pass the combined features and labels to your LSTM model for training.
Let us know if any of the above solution works for you!