Skip to content

Instantly share code, notes, and snippets.

@GermanCM
Created December 19, 2018 10:36
Show Gist options
  • Save GermanCM/3a74f0be4cf83cd11313306ffbea8ea6 to your computer and use it in GitHub Desktop.
Save GermanCM/3a74f0be4cf83cd11313306ffbea8ea6 to your computer and use it in GitHub Desktop.
r2 score via scikit-learn
def find_r2_score(labels_test, predicted_outputs):
from sklearn.metrics import r2_score
corr_coeff = r2_score(labels_test, predicted_outputs)
print('the value of r2 is: ', corr_coeff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment