Book Image

Principles of Data Science - Second Edition

By : Sinan Ozdemir, Sunil Kakade, Marco Tibaldeschi
Book Image

Principles of Data Science - Second Edition

By: Sinan Ozdemir, Sunil Kakade, Marco Tibaldeschi

Overview of this book

Need to turn programming skills into effective data science skills? This book helps you connect mathematics, programming, and business analysis. You’ll feel confident asking—and answering—complex, sophisticated questions of your data, making abstract and raw statistics into actionable ideas. Going through the data science pipeline, you'll clean and prepare data and learn effective data mining strategies and techniques to gain a comprehensive view of how the data science puzzle fits together. You’ll learn fundamentals of computational mathematics and statistics and pseudo-code used by data scientists and analysts. You’ll learn machine learning, discovering statistical models that help control and navigate even the densest datasets, and learn powerful visualizations that communicate what your data means.
Table of Contents (17 chapters)
16
Index

The rules of probability

In probability, we have some rules that become very useful when visualization gets too cumbersome. These rules help us calculate compound probabilities with ease.

The addition rule

The addition rule is used to calculate the probability of either or events. To calculateThe addition rule, we use the following formula:

The addition rule

The first part of the formula (P(A) + P(B)) makes complete sense. To get the union of the two events, we have to add together the area of the circles in the universe. But why the subtraction of P(A and B)? This is because when we add the two circles, we are adding the area of intersection twice, as shown in the following diagram:

The addition rule

See how both the red circles include the intersection of A and B? So, when we add them, we need to subtract just one of them to account for this, leaving us with our formula.

You will recall that we wanted the number of people who either had cancer or had a positive test result. If A is the event that someone has cancer, and B is that the test result...