How to generate data for prediction using TimeseriesGenerator?

Viewed 16

I have time series data containing 2 input columns and 1 output. I have used TimeseriesGenerator to generate data for training like follows:

n_input = 96
n_features= len(prediction_columns)
b_size = 873

generator = TimeseriesGenerator(train[data_columns].to_numpy(), train[prediction_columns].to_numpy(), length=n_input, batch_size=b_size)

...

h=model.fit(generator, batch_size=b_size,callbacks=[TerminateOnNaN()])

Now I want to take the full_data, put it into model.predict and see the output. I'm trying

generator = TimeseriesGenerator(data[data_columns].to_numpy(), data[prediction_columns].to_numpy(), length=n_input, batch_size=1)

p=model.predict(generator)

But that complains about invalid input shape. TimeseriesGenerator cannot be created without providing x and y inputs.

I'm looking for a class like TimeseriesGenerator that would output data in correct shape right away

What is the best way to get data in format usable for model.predict function?

0 Answers
Related