Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Now We Can Answer | The First A/B Test
A/B Testing in Python

book
Now We Can Answer

This chapter will help us to answer the question 'Can we believe that the variant of the site will help us to increase in clicks?'

So, we have studied how do 2 groups' distributions look like:

  • Their plots don't look similar;

  • Their confidence intervals don' cover each other a lot.

Earlier, we decided that we were going to use t-criterion criterion to cope with our problem. It is our last check to prove whether there is a NON-RANDOM difference between groups.

To perform the t-test use scipy.stats.ttest_ind(control_group_data, test_group_data).

Opgave

Swipe to start coding

  1. Perform the t-test.

Løsning

# Importing the pandas
import pandas as pd
# Importing the seaborn
import seaborn as sns
# Importing the scipy
import scipy

# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/ae14b913-9d96-48cb-ace7-a332315f7cf4/ab+test+1.csv')
# Control group
df_control = df.query('group == "control" ')
# Test group
df_test = df.query('group == "test" ')

# Perform the t-test
print(scipy.stats.ttest_ind(df_control.clicks, df_test.clicks))

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 7
# Importing the pandas
import pandas as pd
# Importing the seaborn
import seaborn as sns
# Importing the scipy
import scipy

# Reading the file
df = pd.read_csv('https://codefinity-content-media.s3.eu-west-1.amazonaws.com/ae14b913-9d96-48cb-ace7-a332315f7cf4/ab+test+1.csv')
# Control group
df_control = df.query('group == "control" ')
# Test group
df_test = df.query('group == "test" ')

# Perform the t-test
print(___.stats.___(df_control.___, ___))

Spørg AI

expand
ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

some-alt