daily pastebin goal
59%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 60 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. yhat = model.predict(test_X)
  2. test_Xt = test_X.reshape((test_X.shape[0], test_X.shape[2]))
  3. # invert scaling for forecast
  4. inv_yhat = np.concatenate((yhat, test_Xt[:, 1:]), axis=1)
  5. inv_yhat = scaler.inverse_transform(inv_yhat)
  6. inv_yhat = inv_yhat[:,0]
  7. # invert scaling for actual
  8. test_yt = test_y.reshape((len(test_y), 1))
  9. inv_y = np.concatenate((test_yt, test_Xt[:, 1:]), axis=1)
  10. inv_y = scaler.inverse_transform(inv_y)
  11. inv_y = inv_y[:,0]
  12. # calculate RMSE
  13. rmse = np.sqrt(mean_squared_error(inv_y, inv_yhat))
  14. print('Test RMSE: %.3f' % rmse)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top