avatarVishal Sharma

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2414

Abstract

ow likely is it to happen?</p><p id="6553">In probability, binomial distribution can be written in this PMF (Probability Mass Function):</p><figure id="80c5"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*82Np1Wmmm6IhYnHE-gKSyw.png"><figcaption>Binomial Distribution formula — <a href="https://www.onlinemathlearning.com/">OnlineMathLearning</a></figcaption></figure><p id="1399">Binomial Distribution is highly used in Logistic Regression models, where you want to predict something like “How likely is it that this bank customer will commit a credit fraud?” or “How likely will people buy our new product?”.</p><h2 id="423f">Condition Probability</h2><p id="a489">In real life, events most often than not depend on each other.</p><p id="e97e">Let’s say we have two coins. The probability of Heads or Tails is 0.5 (equally likely). What is the probability that both flips’ outcome is “Heads” if the first flip lands on heads?</p><blockquote id="0a12"><p><b>Condition:</b> For the second coin to be tossed, our first coin should land “Heads”.</p></blockquote><p id="efa6">How do we solve this?</p><p id="cb4a">Keep this golden statement while solving such problems, <b>the probability that E occurs given that F has already occurred.</b></p><p id="646c">where E= event of interest and F= known or assumed event to have occurred.</p><figure id="003f"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*xI_pBf6DWGKyvz2LqcGe3w.png"><figcaption>Conditional Probability formulae</figcaption></figure><p id="588e">Conditional Probability or <i>P(E|F)</i><b> </b>of <b>“HH” </b>given “<b>HH, HT</b>” will be 1/2 or 0.5.</p><h2 id="40cc">Bayes Rule</h2><p id="c816">Reverend Thomas Bayes was a mathematician who tried and used Bayes Rule to find the existence of the god. But, in doing so he created a new series of methods that are vastly used in artificial intelligence nowadays.</p><p id="d366">What does Bayes rule do?</p><p id="a59c">Let’s say 1% of the population has cancer. Given that there is a 90% chance that you will test positive if you have cancer and that there is a 90% chance you will test negative if you don’t have cancer, what is the probability that you have cancer if you test positive?</p><p id="302e">The essence of Bayes Rule lies in the form:</p><p id="cd35" type="7">Prior Probability . Test Evidence = Posterior Probability</p><p id="4d6d">In our example, Prior

Options

ity is <i>P(C)=0.01</i>, <i>P(Not C)=0.99</i>, <i>P(Pos/C)=0.9</i>, and <i>P(Pos/Not C)=0.1</i>.</p><p id="0c8c">While our posterior probability will be <i>P(C/P)</i> i.e Probability that you have cancer given that you tested positive.</p><p id="2397">So, P(C/P)= P(C) x P(Pos/C) will be our posterior equation <b>nearly</b>. I wrote nearly because if you would sum up the <i>P(C/P) </i>i.e<i> 0.009 </i>and<i> P(Not C/P) </i>i.e <i>0.099, </i>they won’t add up to 1. So, let’s call it <b>“Joint Probability”</b> for now!</p><p id="a709">You have to normalize these two guys here by summing them up.</p><p id="dcbc" type="7">Normalize = P(C/P) + P(Not C/P) i.e 0.108</p><p id="bcc4">Finally, you can come up with the actual posterior.</p><p id="2cd7" type="7">Posterior= Joint Probability / Normalize</p><p id="d247">Posterior for <i>P(C/P)</i> will be<i> 0.009 </i>divided by<i> 0.108</i>, resulting in <i>0.0833</i>. And, for <i>P(Not C/P)</i> will be <i>0.9167</i>. And, now, adding these two will result in 1.</p><figure id="11c6"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*LB-G6WBuswEfpg20FMighA.png"><figcaption>Bayes Rule</figcaption></figure><p id="2d06">Bayes Rule goes all along with Artificial Intelligence especially self-driving cars. It makes Bayes Rule extremely important in robotics.</p><h2 id="f739">Summary</h2><p id="ca2e">I have listed some of the basic probability concepts above including:</p><ol><li>What is Probability?</li><li>Binomial Distribution</li><li>Conditional Probability</li><li>Bayes Rule</li></ol><p id="dd5d">In my next article, I will be talking about Normal Distribution Theory, Sampling Distribution, Central Limit Theorem.</p><div id="7c26" class="link-block"> <a href="https://readmedium.com/learning-intermediate-probability-principles-for-data-science-da83e4bca5d0"> <div> <div> <h2>Learning Intermediate Probability principles for Data Science</h2> <div><h3>Normal Distribution Theory, Sample Distribution, Central Limit Theorem</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*65LYzQ3DY5Jf-32KioeA3g.jpeg)"></div> </div> </div> </a> </div><p id="f10b"><b>Peace!</b></p></article></body>

Maths for Data Science

Learning Basic Probability for Data Science

Binomial Distribution, Conditional Probability, Bayes Rule

Photo by Markus Winkler on Unsplash

Data Science is a vast field that mainly requires strong statistics and probability knowledge. Therefore, it is very important to understand the concepts of these two domains. Being the science of uncertainty, the probability is the most important subject in data science.

I decided to make a series of articles with Probability and Statistics as my main subject.

What is probability?

Let’s estimate the likelihood of an event!

In layman terms, probability lets us know how likely an event is to occur. In data science, we make predictions about future events based on models or causes that we assume. Probability dances between two numerical values 0 and 1. Zero being the impossible outcome and one being a certain outcome.

A most common example being, outcome of a coin flip could either be T or H for the event that the coin flips tails or heads.

P(H)=0.5 means the probability of ‘Heads’ outcome from a coin flip is 0.5. It means P(T) will be 1 – 0.5 i.e 0.5.

The probability of the complement event is 1 minus the probability of an event. It means that the probability of all other possible events is 1 minus the probability an event itself. Hence, the sum of all possible events is equal to 1.

Binomial distribution

In probability theory, the Binomial Distribution helps us determine the number of successful outcomes from a string of independent experiments.

Let’s say we are flipping two coins simultaneously and we are looking for the probability of an event where the outcome is “HH”. Or, The probability of 3 heads occurring in 10 flips. How likely is it to happen?

In probability, binomial distribution can be written in this PMF (Probability Mass Function):

Binomial Distribution formula — OnlineMathLearning

Binomial Distribution is highly used in Logistic Regression models, where you want to predict something like “How likely is it that this bank customer will commit a credit fraud?” or “How likely will people buy our new product?”.

Condition Probability

In real life, events most often than not depend on each other.

Let’s say we have two coins. The probability of Heads or Tails is 0.5 (equally likely). What is the probability that both flips’ outcome is “Heads” if the first flip lands on heads?

Condition: For the second coin to be tossed, our first coin should land “Heads”.

How do we solve this?

Keep this golden statement while solving such problems, the probability that E occurs given that F has already occurred.

where E= event of interest and F= known or assumed event to have occurred.

Conditional Probability formulae

Conditional Probability or P(E|F) of “HH” given “HH, HT” will be 1/2 or 0.5.

Bayes Rule

Reverend Thomas Bayes was a mathematician who tried and used Bayes Rule to find the existence of the god. But, in doing so he created a new series of methods that are vastly used in artificial intelligence nowadays.

What does Bayes rule do?

Let’s say 1% of the population has cancer. Given that there is a 90% chance that you will test positive if you have cancer and that there is a 90% chance you will test negative if you don’t have cancer, what is the probability that you have cancer if you test positive?

The essence of Bayes Rule lies in the form:

Prior Probability . Test Evidence = Posterior Probability

In our example, Priority is P(C)=0.01, P(Not C)=0.99, P(Pos/C)=0.9, and P(Pos/Not C)=0.1.

While our posterior probability will be P(C/P) i.e Probability that you have cancer given that you tested positive.

So, P(C/P)= P(C) x P(Pos/C) will be our posterior equation nearly. I wrote nearly because if you would sum up the P(C/P) i.e 0.009 and P(Not C/P) i.e 0.099, they won’t add up to 1. So, let’s call it “Joint Probability” for now!

You have to normalize these two guys here by summing them up.

Normalize = P(C/P) + P(Not C/P) i.e 0.108

Finally, you can come up with the actual posterior.

Posterior= Joint Probability / Normalize

Posterior for P(C/P) will be 0.009 divided by 0.108, resulting in 0.0833. And, for P(Not C/P) will be 0.9167. And, now, adding these two will result in 1.

Bayes Rule

Bayes Rule goes all along with Artificial Intelligence especially self-driving cars. It makes Bayes Rule extremely important in robotics.

Summary

I have listed some of the basic probability concepts above including:

  1. What is Probability?
  2. Binomial Distribution
  3. Conditional Probability
  4. Bayes Rule

In my next article, I will be talking about Normal Distribution Theory, Sampling Distribution, Central Limit Theorem.

Peace!

Data Science
Mathematics
Statistics
Probability
Data
Recommended from ReadMedium