Who is Bayes? What is Bayes?

Analisi dei dati bayesiana in Python

Michal Oleszak

Machine Learning Engineer

Who is Bayes?

Thomas Bayes

1 Public Domain, https://commons.wikimedia.org/w/index.php?curid=14532025
Analisi dei dati bayesiana in Python

Should you take your umbrella?

A weatherperson forecasting 50% or rain.

Heavy, dark clouds and a thunder.

Analisi dei dati bayesiana in Python

What is Bayes?

  • Bayesian inference means updating one's belief about something as the new information becomes available.
Analisi dei dati bayesiana in Python

What is Bayes?

  • Bayesian inference means updating one's belief about something as the new information becomes available.

  • It is quite different from the classical approach.

 

 

Frequentist (classical) approach Bayesian approach
probability
parameters
Analisi dei dati bayesiana in Python

What is Bayes?

  • Bayesian inference means updating one's belief about something as the new information becomes available.

  • It is quite different from the classical approach.

 

 

Frequentist (classical) approach Bayesian approach
probability proportion of outcomes degree of belief
parameters
Analisi dei dati bayesiana in Python

What is Bayes?

  • Bayesian inference means updating one's belief about something as the new information becomes available.

  • It is quite different from the classical approach.

 

 

Frequentist (classical) approach Bayesian approach
probability proportion of outcomes degree of belief
parameters fixed values random variables
Analisi dei dati bayesiana in Python

It pays to go Bayes!

  • Natural handling of uncertainty (because parameters have distributions!).
  • Possibility to include expert opinion or domain knowledge in the model (because probability means the degree of belief!).
  • No need to rely on fixed constants such as p-values.
  • Statistically correct even with little data.
  • Often coincides with frequentist results, but offers more flexibility to build custom models.
Analisi dei dati bayesiana in Python

Probability distributions

  • A distribution of a random variable specifies what values this variable can take, and with what probabilities.
  • Can be discrete (finite set of possible values) or continuous (infinitely many possible values)
  • Continuous distributions can be visualized on a density plot.

A symmetric, bell-shaped curve peaking around the X-axis value of 165.

Analisi dei dati bayesiana in Python

Distributions in Python

print(draws)
[146.58686154393, 159.40688614250, ..., ]

 

print(len(draws))
10000
import matplotlib.pyplot as plt
import seaborn as sns
sns.kdeplot(draws, shade=True)
plt.show()

A symmetric, bell-shaped curve peaking around the X-axis value of 165.

Analisi dei dati bayesiana in Python

Let's go Bayes!

Analisi dei dati bayesiana in Python

Preparing Video For Download...