Aan de slagGa gratis aan de slag

Comparing conversion rates

Now that we know allocation is relatively even let's look at the conversion rate for the control and personalization. Since we chose conversion rate as our key metrics for this test, it is highly important that we evaluate whether or not conversion was higher in the personalization treatment compared with the control. While we will dive in deeper in subsequent exercises, measuring the difference between the key metric in the control and the treatment is the most important part of evaluating the success of an A/B test.

The DataFrame email has been loaded in your workspace which contains only rows from the marketing DataFrame where marketing_channel is 'Email'.

Deze oefening maakt deel uit van de cursus

Analyzing Marketing Campaigns with pandas

Cursus bekijken

Oefeninstructies

  • Group the email DataFrame by user_id and variant while selecting the maximum value of the converted column and store the results in subscribers.
  • Drop missing values from the control column of subscribers_df.
  • Drop missing values from the personalization column of subscribers_df.
  • Calculate the conversion rate for both personalization and control using the appropriate function for each.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Group marketing by user_id and variant
subscribers = email.____(['user_id', 
                             ____])____
subscribers_df = pd.DataFrame(subscribers.unstack(level=1)) 

# Drop missing values from the control column
control = ____

# Drop missing values from the personalization column
personalization = ____

print('Control conversion rate:', ____)
print('Personalization conversion rate:', ____)
Code bewerken en uitvoeren