Categories
Misc

Forecast of a time series with tensorflow and neural network

hi, in the time series of the following notebook:

https://github.com/https-deeplearning-ai/tensorflow-1-public/blob/main/C4/W2/ungraded_labs/C4_W2_Lab_2_single_layer_NN.ipynb

I understood how to analyze the train set and the validation set with a neural network with tensorflow but I did not understand how to analyze the testing set. I wrote the following code to analyze it. Can you tell me if it’s right? thank you

forecast = [] n=len(series) time_test = np.arange(n, n+365-window_size, dtype=”float32″)

for time in range(n, n+365 – window_size): pred=model.predict(series[time-window_size:time ][np.newaxis]) forecast.append(pred) series=np.append(series,pred)

results = np.array(forecast)[:, 0, 0]

plt.figure(figsize=(10, 6))

plot_series(time_valid, x_valid) plot_series(time_test, results)</code>

submitted by /u/gianni-rosa
[visit reddit] [comments]

Leave a Reply

Your email address will not be published. Required fields are marked *