{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "e6fea6f2-a78b-eef2-cae5-252a7e3d684b"
      },
      "outputs": [],
      "source": [
        "import numpy as np\n",
        "import pandas as pd\n",
        "from sklearn import neighbors, metrics, cross_validation"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "86873c0d-ecba-a1c1-bf79-9b84ba436e4d"
      },
      "outputs": [],
      "source": [
        "data = pd.read_csv('../input/train.csv')\n",
        "X = data.iloc[:, 1:].copy()\n",
        "y = data.label.copy()"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "d7b39ddd-a575-2ef1-ce10-d0bf9285164f"
      },
      "outputs": [],
      "source": [
        "nnclassifier = neighbors.KNeighborsClassifier(1)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "41f17b68-dcf5-cd72-497a-792796ebf4bd"
      },
      "outputs": [],
      "source": [
        "#print(cross_validation.cross_val_score(nnclassifier, X, y, cv=2, scoring='accuracy').mean())"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "_cell_guid": "012064f5-6c43-e3f7-7b9b-1d55982293f2"
      },
      "outputs": [],
      "source": [
        "nnclassifier.fit(X, y)"
      ]
    }
  ],
  "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
}