Created
March 8, 2020 05:33
-
-
Save tirthajyoti/9ddbf0cd16f9897c0b0c85b9cbd43ac3 to your computer and use it in GitHub Desktop.
bayes-3.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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