from tensorflow.keras.preprocessing.sequence import TimeseriesGenerator Define sequence…
- User
from tensorflow.keras.preprocessing.sequence import TimeseriesGenerator
Define sequence length for the time series data
sequence_length = 10 # Adjust as needed based on the length of sequences used during training
Example unseen date data in the format (Year, Month, Day)
unseen_dates = np.array([[2023, 10, 11], [2023, 12, 12], [2023, 12, 13], [2023, 11, 14], [2023, 12, 15], [2023, 12, 16]])
Create TimeseriesGenerator for unseen date data
unseen_generator = TimeseriesGenerator(data=unseen_dates, targets=unseen_dates, # Use the date data itself as targets length=sequence_length, batch_size=1)
Make predictions on the unseen date data
predictions = model.predict(unseen_generator)
Print the predictions
print(predictions)
- Assistant