Decision analysis

Bayesian Data Analysis in Python

Michal Oleszak

Machine Learning Engineer

Decision analysis

  • Decision-makers care about maximizing profit, reducing costs, saving lives, etc.

A syringe next to three bank notes and a digit 99%. An arrow points from it to a single person icon.

Bayesian Data Analysis in Python

Decision analysis

  • Decision-makers care about maximizing profit, reducing costs, saving lives, etc.

A syringe next to a single bank note and a digit 98%. An arrow points from it to a group of people.

  • Decision analysis   →   translating parameters to relevant metrics to inform decision-making
Bayesian Data Analysis in Python

From posteriors to decisions

  • To make strategic decisions, one should know the probabilities of different scenarios.
  • Bayesian methods allow us to translate parameters into relevant metrics easily.

 

A icon representing a click rate distribution.

Bayesian Data Analysis in Python

From posteriors to decisions

  • To make strategic decisions, one should know the probabilities of different scenarios.
  • Bayesian methods allow us to translate parameters into relevant metrics easily.

 

A icon representing a click rate distribution multiplied with "impressions".

Bayesian Data Analysis in Python

From posteriors to decisions

  • To make strategic decisions, one should know the probabilities of different scenarios.
  • Bayesian methods allow us to translate parameters into relevant metrics easily.

 

A icon representing a click rate distribution multiplied with "impressions", multiplied with "revenue per click".

Bayesian Data Analysis in Python

From posteriors to decisions

  • To make strategic decisions, one should know the probabilities of different scenarios.
  • Bayesian methods allow us to translate parameters into relevant metrics easily.

 

A icon representing a click rate distribution multiplied with "impressions", multiplied with "revenue per click", equals an icon representing a revenue distribution.

Bayesian Data Analysis in Python

Posterior revenue

# Different revenue per click
num_impressions = 1000
rev_per_click_A = 3.6
rev_per_click_B = 3


# Compute number of clicks num_clicks_A = A_posterior * num_impressions num_clicks_B = B_posterior * num_impressions
# Compute posterior revenue rev_A = num_clicks_A * rev_per_click_A rev_B = num_clicks_B * rev_per_click_B

Two density plots slightly overlapping.

Two density plots overlapping to a large extent.

Bayesian Data Analysis in Python

Forest plot

import pymc3 as pm


# Collect posterior draws in a dictionary revenue = {"A": rev_A, "B": rev_B}
# Draw the forest plot pm.forestplot(revenue)

A plot showing two lines, each of them denoting one distribution. The length of each line represents the 94% credible interval.

Bayesian Data Analysis in Python

Forest plot

import pymc3 as pm

# Collect posterior draws in a dictionary
revenue = {"A": rev_A, "B": rev_B}

# Draw the forest plot
pm.forestplot(revenue, hdi_prob=0.99)

A plot showing two lines, each of them denoting one distribution. The length of each line represents the 99% credible interval.

Bayesian Data Analysis in Python

Let's analyze decisions!

Bayesian Data Analysis in Python

Preparing Video For Download...