conditional probability fix

This commit is contained in:
lukew3
2020-10-23 13:56:22 -04:00
parent 5cd935f998
commit 1cec34bb70
3 changed files with 111 additions and 107 deletions

View File

@@ -16,10 +16,12 @@ def conditionalProbFunc():
problem = "Someone tested positive for a nasty disease which only {0:.2f}% of population have. " \
"Test sensitivity (true positive) is equal to SN= {1:.2f}% whereas test specificity (true negative) SP= {2:.2f}%. " \
"What is the probability that this guy really has that disease?".format(P_disease, true_positive, true_negative)
"What is the probability that this guy really has that disease?".format(
P_disease, true_positive, true_negative)
answer = str(round(BayesFormula(P_disease, true_positive, true_negative), 2)) + "%"
return problem, answer
conditionalProb = Generator("Conditional Probability", 101, "P(A|+)=", "c", conditionalProbFunc)
conditional_probability = Generator("Conditional Probability",
105, "P(A|+)=", "c", conditionalProbFunc)