Skip to content

Instantly share code, notes, and snippets.

@eugeneyan
Created February 21, 2021 19:13
Show Gist options
  • Save eugeneyan/920bd9ee4f2c9c60de3154089faf5b72 to your computer and use it in GitHub Desktop.
Save eugeneyan/920bd9ee4f2c9c60de3154089faf5b72 to your computer and use it in GitHub Desktop.
Test evaluation
def test_dt_evaluation(dummy_titanic_dt, dummy_titanic):
model = dummy_titanic_dt
X_train, y_train, X_test, y_test = dummy_titanic
pred_test = model.predict(X_test)
pred_test_binary = np.round(pred_test)
acc_test = accuracy_score(y_test, pred_test_binary)
auc_test = roc_auc_score(y_test, pred_test)
assert acc_test > 0.82, 'Accuracy on test should be > 0.82'
assert auc_test > 0.84, 'AUC ROC on test should be > 0.84'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment