Skip to content

Instantly share code, notes, and snippets.

@prafulgondane
Last active June 20, 2022 17:01
Show Gist options
  • Save prafulgondane/fda2e6b606cbea9ed635673fa18c3177 to your computer and use it in GitHub Desktop.
Save prafulgondane/fda2e6b606cbea9ed635673fa18c3177 to your computer and use it in GitHub Desktop.
bias_metrics_cv_df = compute_bias_metrics_for_model(df_cv, identity_columns, MODEL_NAME, TOXICITY_COLUMN)
print("Overall AUC for Train Data : ", get_final_metric(bias_metrics_train_df, calculate_overall_auc(df_train, MODEL_NAME)))
print("#"*100)
print("Overall AUC for CV Data : ", get_final_metric(bias_metrics_cv_df, calculate_overall_auc(df_cv, MODEL_NAME)))
print("#"*100)
print(" Train Data : ")
print("#"*100)
tr_pred = np.where(df_train[MODEL_NAME] >= 0.5, 1, 0)
plot_confusion_matrix(train_labels[:,1], tr_pred)
print(" CV Data : ")
print("#"*100)
cv_pred = np.where(df_cv[MODEL_NAME] >= 0.5, 1, 0)
plot_confusion_matrix(cv_labels[:,1], cv_pred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment