-
-
Save ashwinprasadme/80fe0bebdce5853323137e91d6ef0d5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
np.sqrt(((dataY_plot[-testX.size()[0]:] - data_predict[-testX.size()[0]:] ) ** 2).mean()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAE = mean_absolute_error(LSTM_test_outputs, predictions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def model_score(model, X_train, y_train, X_test, y_test): | |
trainScore = model.evaluate(X_train, y_train, verbose=0) | |
print('Train Score: %.5f MSE (%.2f RMSE)' % (trainScore[0], math.sqrt(trainScore[0]))) | |
testScore = model.evaluate(X_test, y_test, verbose=0) | |
print('Test Score: %.5f MSE (%.2f RMSE)' % (testScore[0], math.sqrt(testScore[0]))) | |
return trainScore[0], testScore[0] | |
model_score(model, X_train, y_train, X_test, y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def return_rmse(test,predicted): | |
rmse = math.sqrt(mean_squared_error(test, predicted)) | |
print("The root mean squared error is {}.".format(rmse)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment