Skip to content

Instantly share code, notes, and snippets.

@sadimanna
Last active June 20, 2020 14:50
Show Gist options
  • Save sadimanna/d76f097f0cca313b2e3fe1de63ca1b56 to your computer and use it in GitHub Desktop.
Save sadimanna/d76f097f0cca313b2e3fe1de63ca1b56 to your computer and use it in GitHub Desktop.
def TP(y, pred, th=0.5):
pred_t = (pred > th)
return np.sum((pred_t == True) & (y == 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment