Last active
October 2, 2018 10:32
-
-
Save animesh-agarwal/709dece9f880c6c9c37110988e2a8871 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# model evaluation for training set | |
y_train_predict = lin_model.predict(X_train) | |
rmse = (np.sqrt(mean_squared_error(Y_train, y_train_predict))) | |
r2 = r2_score(Y_train, y_train_predict) | |
print("The model performance for training set") | |
print("--------------------------------------") | |
print('RMSE is {}'.format(rmse)) | |
print('R2 score is {}'.format(r2)) | |
print("\n") | |
# model evaluation for testing set | |
y_test_predict = lin_model.predict(X_test) | |
rmse = (np.sqrt(mean_squared_error(Y_test, y_test_predict))) | |
r2 = r2_score(Y_test, y_test_predict) | |
print("The model performance for testing set") | |
print("--------------------------------------") | |
print('RMSE is {}'.format(rmse)) | |
print('R2 score is {}'.format(r2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment