How bad can it be?
You have concluded that with 98% probability, clothes ads have a higher click-through ratio than sneakers ads. This suggests rolling out the clothes campaign to a larger audience. However, there is a 2% risk that it's the sneakers ads that are actually better. If that's the case, how many clicks do we lose if we roll out the clothes campaign?
The answer to this is the expected loss: the average posterior difference between the two click-through ratios given that sneakers ads do better. To calculate it, you only need to take the entries in the posterior difference where the sneakers click-through rate is higher and compute their average.
The posterior difference between the click rates, diff, is available in your workspace. Let's find out how much is at risk!
Este exercício faz parte do curso
Bayesian Data Analysis in Python
Instruções do exercício
- Slice
diffto take only cases where it is negative (corresponding to sneakers click rate being higher) and assign the result toloss. - Calculate the average
loss, assign it toexpected_lossand print it.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
# Slice diff to take only cases where it is negative
loss = ____
# Compute and print expected loss
expected_loss = ____
print(____)