Skip to content

Instantly share code, notes, and snippets.

@sadimanna
Created June 20, 2020 16:15
Show Gist options
  • Save sadimanna/dd3b016576c605ced5120b42652d3494 to your computer and use it in GitHub Desktop.
Save sadimanna/dd3b016576c605ced5120b42652d3494 to your computer and use it in GitHub Desktop.
def prevalence(y):
return np.sum(y)/y.shape[0]
def prevalence(y,pred):
tp = TP(y,pred,th)
fp = FP(y,pred,th)
tn = TN(y,pred,th)
fn = FN(y,pred,th)
return (tp+fn)/(tp+fp+tn+fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment