{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.20.3\n", "1.14.2\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/usr/local/lib/python2.7/dist-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n", " \"This module will be removed in 0.20.\", DeprecationWarning)\n" ] } ], "source": [ "import os\n", "import numpy as np\n", "import pandas as pd\n", "from sklearn.cross_validation import train_test_split\n", "from sklearn.metrics import accuracy_score\n", "from sklearn.neighbors import KNeighborsClassifier\n", "\n", "print pd.__version__\n", "print np.__version__" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
| \n", " | id | \n", "ri | \n", "na | \n", "mg | \n", "al | \n", "si | \n", "k | \n", "ca | \n", "ba | \n", "fe | \n", "class | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "1 | \n", "1.52101 | \n", "13.64 | \n", "4.49 | \n", "1.10 | \n", "71.78 | \n", "0.06 | \n", "8.75 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "
| 1 | \n", "2 | \n", "1.51761 | \n", "13.89 | \n", "3.60 | \n", "1.36 | \n", "72.73 | \n", "0.48 | \n", "7.83 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "
| 2 | \n", "3 | \n", "1.51618 | \n", "13.53 | \n", "3.55 | \n", "1.54 | \n", "72.99 | \n", "0.39 | \n", "7.78 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "
| 3 | \n", "4 | \n", "1.51766 | \n", "13.21 | \n", "3.69 | \n", "1.29 | \n", "72.61 | \n", "0.57 | \n", "8.22 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "
| 4 | \n", "5 | \n", "1.51742 | \n", "13.27 | \n", "3.62 | \n", "1.24 | \n", "73.08 | \n", "0.55 | \n", "8.07 | \n", "0.0 | \n", "0.0 | \n", "1 | \n", "