Skip to content

Instantly share code, notes, and snippets.

@tirthajyoti
Created March 8, 2020 05:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirthajyoti/07e3c81839957423fef62f0ac5bd3ea7 to your computer and use it in GitHub Desktop.
Save tirthajyoti/07e3c81839957423fef62f0ac5bd3ea7 to your computer and use it in GitHub Desktop.
bayes-2.py
ps = []
pres = []
for pre in [i*0.001 for i in range(1,51,2)]:
pres.append(pre*100)
p = drug_user(prob_th=0.5,sensitivity=0.97,specificity=0.95,prevelance=pre,verbose=False)
ps.append(p)
plt.figure(figsize=(10,5))
plt.title("Probability of user with prevelance rate",fontsize=15)
plt.plot(pres,ps,color='k',marker='o',markersize=8)
plt.grid(True)
plt.xlabel("Prevelance (percentage)",fontsize=14)
plt.ylabel("Probability of being an user",fontsize=14)
plt.xticks([i*0.25 for i in range(1,21)],fontsize=12,rotation=45)
plt.yticks(fontsize=12)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment