Aan de slagGa gratis aan de slag

Decision analysis: profit

Good job translating the posterior click rates into cost distributions! In the meantime, a new company policy has been released. From now on, the goal of the marketing department is not to minimize the costs of campaigns, which was quite ineffective, but rather to maximize the profit. Can you adjust your findings accordingly, knowing that the expected revenue per click from a mobile ad is $3.4, and the one from a desktop ad is $3? To calculate the profit, you need to calculate the revenue from all clicks, then subtract the corresponding cost from it.

Everything you have calculated in the previous exercise is available in your workspace: the ads_cost dictionary as well as the number of click distributions: clothes_num_clicks and sneakers_num_clicks.

Deze oefening maakt deel uit van de cursus

Bayesian Data Analysis in Python

Cursus bekijken

Oefeninstructies

  • Create a dictionary ads_profit with four keys: clothes_mobile, sneakers_mobile, clothes_desktop, and sneakers_sneakers, each holding the profit distribution from corresponding clicks.
  • Draw a forest plot of ads_proft using the credible interval of 99%.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate profit distributions for each product and platform
ads_profit = {
    "clothes_mobile": ____,
    "sneakers_mobile": ____,
    "clothes_desktop": ____,
    "sneakers_desktop": ____,
}

# Draw a forest plot of ads_profit
____
plt.show()
Code bewerken en uitvoeren