{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "45c38102-9bee-ffb1-36d1-5d716f55a9d1"
      },
      "outputs": [],
      "source": [
        "set.seed(0)\n",
        "require(data.table)\n",
        "\n",
        "#train = fread('/home/mikeskim/Desktop/kaggle/fb2016/data/train.csv',colClasses=c(rep('numeric',5),'character'))\n",
        "test = fread('../input/test.csv')\n",
        "\n",
        "\n",
        "#train$place_id=NULL\n",
        "#both = rbind(train,test) #merge"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "336fee34-638d-7037-4ec4-478bc15e2415"
      },
      "outputs": [],
      "source": [
        "both = test"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "ed63863e-ada1-017a-4e79-da0c81d7d42f"
      },
      "outputs": [],
      "source": [
        "both$timer = round(both$time/240) #\n",
        "both$rx = round(both$x,1) #\n",
        "both$ry = round(both$y,1) #\n",
        "both$txy = paste(both$timer,both$rx,both$ry) \n",
        "\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "618bc1ef-8a8c-7e3d-a9f7-1714fac0c180"
      },
      "outputs": [],
      "source": [
        "both[, count1 := sd(accuracy), by=txy]\n",
        "hist(both$count1)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "5eab4e3c-41d3-e007-aec5-8172907be635"
      },
      "outputs": [],
      "source": [
        "summary(both)\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "f1205c11-96c8-1532-21f3-e9c643d88ca6"
      },
      "outputs": [],
      "source": [
        "both$count1[is.na(both$count1)]=mean(both$count1,na.rm=T)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "36dc3108-0917-5034-c228-8b5eeb27f176"
      },
      "outputs": [],
      "source": [
        "head(both)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "6c8833df-2442-1c9d-0fcf-7519b0008a2c"
      },
      "outputs": [],
      "source": [
        "help(DT)"
      ]
    }
  ],
  "metadata": {
    "_change_revision": 0,
    "_is_fork": false,
    "kernelspec": {
      "display_name": "R",
      "language": "R",
      "name": "ir"
    },
    "language_info": {
      "codemirror_mode": "r",
      "file_extension": ".r",
      "mimetype": "text/x-r-source",
      "name": "R",
      "pygments_lexer": "r",
      "version": "3.3.2"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}