Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Data Science Algorithms in a Week

You're reading from   Data Science Algorithms in a Week Top 7 algorithms for scientific computing, data analysis, and machine learning

Arrow left icon
Product type Paperback
Published in Oct 2018
Publisher Packt
ISBN-13 9781789806076
Length 214 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
David Toth David Toth
Author Profile Icon David Toth
David Toth
David Natingga David Natingga
Author Profile Icon David Natingga
David Natingga
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Classification Using K-Nearest Neighbors 2. Naive Bayes FREE CHAPTER 3. Decision Trees 4. Random Forests 5. Clustering into K Clusters 6. Regression 7. Time Series Analysis 8. Python Reference 9. Statistics 10. Glossary of Algorithms and Methods in Data Science
11. Other Books You May Enjoy

Medical tests – basic application of Bayes' theorem


A patient takes a special cancer test that has an accuracy of test_accuracy=99.9%—if the result is positive, then 99.9% of the patients tested will suffer from that particular type of cancer. Conversely, 99.9% of the patients with a negative result will not suffer from that particular cancer.

Suppose that a patient is tested and the result is positive. What is the probability of that patient suffering from that particular type of cancer?

Analysis

We will use Bayes' theorem to ascertain the probability of the patient having cancer:

To ascertain the prior probability that a patient has cancer, we have to find out how frequently cancer occurs among people. Say that we find out that 1 person in 100,000 suffers from this kind of cancer. Therefore, P(cancer)=1/100,000. So, P(test_positive|cancer) = test_accuracy=99.9%=0.999 given by the accuracy of the test.

P(test_positive) has to be computed as follows:

Therefore, we can calculate the following:

So...

You have been reading a chapter from
Data Science Algorithms in a Week - Second Edition
Published in: Oct 2018
Publisher: Packt
ISBN-13: 9781789806076
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime