{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "view-in-github"
},
"source": [
""
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "H_cCZ26oC09s"
},
"source": [
"
\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"***"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "BQpnBRMDe_mB"
},
"source": [
"## A/B Testing\n",
"\n",
"Here we will look at how to collect and analyze data to determine the difference between two groups. The idea here is that if we randomly assign individuals to two groups we end up with comparable groups. If we then measure how these two groups respond to a treatment (e.g., being given game version A vs. game version B) we can better determine the effect of that treatment. \n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "yFmN1aLjfVej"
},
"source": [
"We'll take a look at data collected to test how effective different versions of a game are at retaining users. \n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"id": "R6oL7k7uftq4"
},
"outputs": [],
"source": [
"#load packages\n",
"import pandas as pd\n",
"import sklearn as sk\n",
"import seaborn as sns\n",
"from matplotlib import pyplot as plt\n",
"from sklearn.model_selection import train_test_split"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "GZ7MxOMHflXV"
},
"source": [
"Load the data"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 206
},
"id": "5NHlsf8GeMWW",
"outputId": "42d4b2c8-2098-4ed6-d2e4-931154d98930"
},
"outputs": [
{
"data": {
"text/html": [
"
\n", " | userid | \n", "version | \n", "sum_gamerounds | \n", "retention_1 | \n", "retention_7 | \n", "
---|---|---|---|---|---|
0 | \n", "116 | \n", "gate_30 | \n", "3 | \n", "False | \n", "False | \n", "
1 | \n", "337 | \n", "gate_30 | \n", "38 | \n", "True | \n", "False | \n", "
2 | \n", "377 | \n", "gate_40 | \n", "165 | \n", "True | \n", "False | \n", "
3 | \n", "483 | \n", "gate_40 | \n", "1 | \n", "False | \n", "False | \n", "
4 | \n", "488 | \n", "gate_40 | \n", "179 | \n", "True | \n", "True | \n", "