Skip to content

Instantly share code, notes, and snippets.

@erykml
Created May 11, 2022 09:47
Show Gist options
  • Select an option

  • Save erykml/2f3af72a824eb24f5c530b2f45f63af4 to your computer and use it in GitHub Desktop.

Select an option

Save erykml/2f3af72a824eb24f5c530b2f45f63af4 to your computer and use it in GitHub Desktop.
pred_df["TP"] = np.where(pred_df["class"] == 1, pred_df["prob"], 0)
pred_df["FP"] = np.where(pred_df["class"] == 1, 1 - pred_df["prob"], 0)
pred_df["TN"] = np.where(pred_df["class"] == 0, 1- pred_df["prob"], 0)
pred_df["FN"] = np.where(pred_df["class"] == 0, pred_df["prob"], 0)
pred_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment