{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "2021-06-27-ad-conversion-simple-ab-testing.ipynb", "provenance": [], "authorship_tag": "ABX9TyNxngMnYxHhMWMH/afqaSew" }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "jzX21dhMG60W" }, "source": [ "# Ad-conversion A-B Testing\n", "> Simple T-test to compare 2 samples of ad-conversions\n", "\n", "- toc: true\n", "- badges: true\n", "- comments: true\n", "- categories: [ABTest]\n", "- image:" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "vQ13VFgf49GE", "outputId": "31f18908-5d9a-4b87-d4f2-1bb3dd397b33" }, "source": [ "!wget https://github.com/sparsh-ai/reco-data/raw/master/abtest-sample-dayC1C2.csv" ], "execution_count": 1, "outputs": [ { "output_type": "stream", "text": [ "--2021-06-27 14:34:04-- https://github.com/sparsh-ai/reco-data/raw/master/abtest-sample-dayC1C2.csv\n", "Resolving github.com (github.com)... 140.82.112.3\n", "Connecting to github.com (github.com)|140.82.112.3|:443... connected.\n", "HTTP request sent, awaiting response... 302 Found\n", "Location: https://raw.githubusercontent.com/sparsh-ai/reco-data/master/abtest-sample-dayC1C2.csv [following]\n", "--2021-06-27 14:34:04-- https://raw.githubusercontent.com/sparsh-ai/reco-data/master/abtest-sample-dayC1C2.csv\n", "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...\n", "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 408 [text/plain]\n", "Saving to: ‘abtest-sample-dayC1C2.csv’\n", "\n", "abtest-sample-dayC1 100%[===================>] 408 --.-KB/s in 0s \n", "\n", "2021-06-27 14:34:04 (13.0 MB/s) - ‘abtest-sample-dayC1C2.csv’ saved [408/408]\n", "\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "id": "6j04Iy0N5C7h" }, "source": [ "import pandas as pd\n", "import numpy as np\n", "import seaborn as sns\n", "import scipy.stats as ss " ], "execution_count": 2, "outputs": [] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 359 }, "id": "4ytG1m5A5Dy3", "outputId": "d5152c41-62ec-419b-9967-eae6a685b8b1" }, "source": [ "data= pd.read_csv(\"abtest-sample-dayC1C2.csv\")\n", "data.head(10)" ], "execution_count": 3, "outputs": [ { "output_type": "execute_result", "data": { "text/html": [ "
\n", " | Day | \n", "Conversion_A | \n", "Conversion_B | \n", "
---|---|---|---|
0 | \n", "1 | \n", "0.15 | \n", "0.19 | \n", "
1 | \n", "2 | \n", "0.12 | \n", "0.20 | \n", "
2 | \n", "3 | \n", "0.18 | \n", "0.18 | \n", "
3 | \n", "4 | \n", "0.19 | \n", "0.22 | \n", "
4 | \n", "5 | \n", "0.17 | \n", "0.19 | \n", "
5 | \n", "6 | \n", "0.13 | \n", "0.17 | \n", "
6 | \n", "7 | \n", "0.14 | \n", "0.18 | \n", "
7 | \n", "8 | \n", "0.23 | \n", "0.20 | \n", "
8 | \n", "9 | \n", "0.11 | \n", "0.17 | \n", "
9 | \n", "10 | \n", "0.15 | \n", "0.22 | \n", "