{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "48235265-7605-bf90-cbe6-02d97ab59fb7"
      },
      "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",
        "from sklearn.neighbors import KNeighborsClassifier\n",
        "from sklearn.model_selection import train_test_split\n",
        "from sklearn import svm, linear_model\n",
        "from sklearn.ensemble import GradientBoostingClassifier\n",
        "\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",
        "types = {'row_id': np.dtype(int),\n",
        "         'x': np.dtype(float),\n",
        "         'y' : np.dtype(float),\n",
        "         'accuracy': np.dtype(int),\n",
        "         'place_id': np.dtype(int) }\n",
        "df_train = pd.read_csv('../input/train.csv', dtype = types, index_col = 0)\n",
        "df_train.info()\n",
        "#df_test = pd.read_csv('../input/test.csv', dtype = types, index_col = 0)\n",
        "print('finished load data')\n",
        "X = df_train[['x','y','accuracy','time']]\n",
        "y = df_train['place_id']\n",
        "del df_train\n",
        "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2)\n",
        "del X, y\n",
        "# Any results you write to the current directory are saved as output."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "df936ccb-d02d-1833-c60e-9142a637ddad"
      },
      "outputs": [],
      "source": [
        "#clf = linear_model.SGDClassifier()\n",
        "#clf = KNeighborsClassifier(n_neighbors = 5)\n",
        "#clf = GradientBoostingClassifier()\n",
        "#clf.fit(X_train, y_train) \n",
        "#print('finished fit')\n",
        "#accuracy = clf.score(X_test, y_test)\n",
        "#print(accuracy)"
      ]
    }
  ],
  "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
}