{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "0d396e13-bd01-18ca-1c39-b985c2715d2f"
      },
      "outputs": [],
      "source": [
        "# This Python 3 environment comes with many helpful analytics libraries installed\n",
        "# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n",
        "# For example, here's several helpful packages to load in \n",
        "\n",
        "import numpy as np # linear algebra\n",
        "import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n",
        "import os\n",
        "import gc # We're gonna be clearing memory a lot\n",
        "from sklearn.model_selection import KFold\n",
        "import matplotlib.pyplot as plt\n",
        "# Input data files are available in the \"../input/\" directory.\n",
        "# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n",
        "\n",
        "from subprocess import check_output\n",
        "print(check_output([\"ls\", \"../input\"]).decode(\"utf8\"))\n",
        "\n",
        "# Any results you write to the current directory are saved as output."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "3b1be7d8-a860-7dfc-b606-a4904d214c01"
      },
      "outputs": [],
      "source": [
        "cl_train=pd.read_csv('../input/clicks_train.csv')\n",
        "cl_test=pd.read_csv('../input/clicks_test.csv')\n",
        "##cl_train.head()\n",
        "temp_test=pd.DataFrame(cl_train.groupby('display_id')['ad_id'].count().value_counts())\n",
        "temp_test.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "6b2fbd4b-b68d-73b4-c533-2bec73a7bc01"
      },
      "outputs": [],
      "source": [
        "temp_test2=pd.DataFrame(cl_train.groupby('display_id')['ad_id'].count())\n",
        "temp_test2"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "30c45c5e-5695-1ad6-fc9e-ea4a1456fad5"
      },
      "outputs": [],
      "source": [
        "cl_train.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "e994803e-a897-587d-065d-c7432fe8b7ca"
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\n",
        "import seaborn as sns\n",
        "sns.barplot(temp_test.index, temp_test.values, alpha=0.8, label='train')"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "620cda80-004c-510a-6db9-bedb883cbf3e"
      },
      "outputs": [],
      "source": [
        "ad_usage_train = pd.DataFrame(cl_train.groupby('ad_id')['ad_id'].count())\n",
        "ad_usage_train.head()\n",
        "#plt.hist(ad_usage_train, bins=50,log=True)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "f1144e5f-8835-8ac1-3c54-5ad11d7e2983"
      },
      "outputs": [],
      "source": [
        "#documents_categories=pd.read_csv('../input/documents_categories.csv')\n",
        "#documents_categories.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "66f18fe8-94a1-d60f-9ea2-9d1e56d15c34"
      },
      "outputs": [],
      "source": [
        "#documents_entities=pd.read_csv('../input/documents_entities.csv')\n",
        "#documents_entities.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "5e031022-258e-b681-fbe3-5a357012b557"
      },
      "outputs": [],
      "source": [
        "##documents_meta=pd.read_csv('../input/documents_meta.csv')\n",
        "#documents_meta.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "b3a26933-362c-5040-975d-fa71d0a73222"
      },
      "outputs": [],
      "source": [
        "#documents_topics=pd.read_csv('../input/documents_topics.csv')\n",
        "#documents_topics.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "3170c90c-0bef-9baf-9219-ebde4324f4e0"
      },
      "outputs": [],
      "source": [
        "events=pd.read_csv('../input/events.csv')\n",
        "events.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "8f3b5287-5867-3f6f-040d-a00fc6f3e9e2"
      },
      "outputs": [],
      "source": [
        "#page_views_sample=pd.read_csv('../input/page_views_sample.csv')\n",
        "#page_views_sample.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "a2ef44f0-9c07-41b6-7bab-0e444df6e2e3"
      },
      "outputs": [],
      "source": [
        "promoted_content=pd.read_csv('../input/promoted_content.csv')\n",
        "promoted_content.head()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "ff83bfb2-0e6d-90a7-3bb0-82144841b171"
      },
      "outputs": [],
      "source": ""
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "848f4f50-5dd6-8f6d-1216-4424635a50e2"
      },
      "outputs": [],
      "source": ""
    }
  ],
  "metadata": {
    "_change_revision": 0,
    "_is_fork": false,
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.5.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}