1 2 3 4 5 6 7 8 9 10 11 12 |
trainPredict = model.predict(trainX) testPredict = model.predict(testX) trainPredict = scaler_train.inverse_transform(trainPredict) trainY = scaler_train.inverse_transform([trainY]) testPredict = scaler_train.inverse_transform(testPredict) testY = scaler_train.inverse_transform([testY]) trainScore = math.sqrt(mean_squared_error(trainY[0], trainPredict[:,0])) print('Train Score: %.2f RMSE' % (trainScore)) testScore = math.sqrt(mean_squared_error(testY[0], testPredict[:,0])) print('Test Score: %.2f RMSE' % (testScore)) |