Skip to content

Instantly share code, notes, and snippets.

@kiote
Created November 2, 2015 12:13
Show Gist options
  • Save kiote/68f0721626b66c8bd4a6 to your computer and use it in GitHub Desktop.
Save kiote/68f0721626b66c8bd4a6 to your computer and use it in GitHub Desktop.
mdl_estimation
# quality of classification
from sklearn.metrics import accuracy_score
y_true = test['numeric_status']
y_pred = result
print "Predicted accuracy: %f" % accuracy_score(y_true, y_pred)
# let's also calculate "baseline accuracy" - when we just say "yes" every time (most common outcome)
baseline = [1] * len(y_pred)
print "Baseline accuracy: %f" % accuracy_score(y_true, baseline)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment