Skip to content

Instantly share code, notes, and snippets.

@tirthajyoti
Created March 8, 2020 05:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tirthajyoti/9ddbf0cd16f9897c0b0c85b9cbd43ac3 to your computer and use it in GitHub Desktop.
Save tirthajyoti/9ddbf0cd16f9897c0b0c85b9cbd43ac3 to your computer and use it in GitHub Desktop.
bayes-3.py
ps = []
sens = []
for sen in [i*0.001+0.95 for i in range(1,50,2)]:
sens.append(sen)
p = drug_user(prob_th=0.5,sensitivity=sen,specificity=0.95,prevelance=0.005,verbose=False)
ps.append(p)
plt.figure(figsize=(10,5))
plt.title("Probability of user with test sensitivity",fontsize=15)
plt.plot(sens,ps,color='k',marker='o',markersize=8)
plt.grid(True)
plt.xlabel("Sensitivity(%)",fontsize=14)
plt.ylabel("Probability of being an user",fontsize=14)
plt.xticks([0.95+i*0.0025 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