Analysis

Problem 1: Before the patient is given the test, the probability that they have the virus is 4%, P(virus)=4%=0.04. The accuracy of the test is test_accuracy=98%=0.98. We apply the formula from the medical test example:

Therefore, we have the following:

 

This means that there is a probability of about 67% that the patient has the virus, ...

Get Data Science Algorithms in a Week - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.