{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Working With Image Data" ] }, { "cell_type": "code", "execution_count": 330, "metadata": {}, "outputs": [], "source": [ "from sklearn.datasets import load_digits\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "\n", "digits_data = load_digits()" ] }, { "cell_type": "code", "execution_count": 331, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['data', 'target', 'target_names', 'images', 'DESCR'])" ] }, "execution_count": 331, "metadata": {}, "output_type": "execute_result" } ], "source": [ "digits_data.keys()" ] }, { "cell_type": "code", "execution_count": 332, "metadata": {}, "outputs": [], "source": [ "labels = pd.Series(digits_data['target'])" ] }, { "cell_type": "code", "execution_count": 333, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
0123456789...54555657585960616263
00.00.05.013.09.01.00.00.00.00.0...0.00.00.00.06.013.010.00.00.00.0
\n", "

1 rows × 64 columns

\n", "
" ], "text/plain": [ " 0 1 2 3 4 5 6 7 8 9 ... 54 55 56 57 \\\n", "0 0.0 0.0 5.0 13.0 9.0 1.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 \n", "\n", " 58 59 60 61 62 63 \n", "0 6.0 13.0 10.0 0.0 0.0 0.0 \n", "\n", "[1 rows x 64 columns]" ] }, "execution_count": 333, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = pd.DataFrame(digits_data['data'])\n", "data.head(1)" ] }, { "cell_type": "code", "execution_count": 334, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 334, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPgAAAD8CAYAAABaQGkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAACtlJREFUeJzt3V9onfUdx/HPZ1HZ/FOsazekqYsBKchgtoaCFITVZdQpuospLShMBr1SlA2s7m53eiPuYghSdYKd0lQFEacTVJywOZO226ypo60dzapryir+GaxUv7vIKXRdtjzp+T1/ztf3C4L5c8jve4jvPs85OXl+jggByOlLbQ8AoD4EDiRG4EBiBA4kRuBAYgQOJEbgQGIEDiRG4EBiZ9XxTZctWxYjIyN1fOtWHTt2rNH1ZmZmGltryZIlja01PDzc2FpDQ0ONrdWkgwcP6ujRo17odrUEPjIyosnJyTq+dasmJiYaXW/Lli2NrTU+Pt7YWvfdd19jay1durSxtZo0NjZW6XacogOJETiQGIEDiRE4kBiBA4kROJAYgQOJETiQWKXAbW+w/a7tfbbvqXsoAGUsGLjtIUm/kHStpMslbbJ9ed2DAehflSP4Wkn7IuJARByX9JSkG+sdC0AJVQJfIenQKR/P9D4HoOOqBD7fX6z818XUbW+2PWl7cnZ2tv/JAPStSuAzklae8vGwpMOn3ygiHo6IsYgYW758ean5APShSuBvSbrM9qW2z5G0UdJz9Y4FoIQF/x48Ik7Yvl3SS5KGJD0aEXtqnwxA3ypd8CEiXpD0Qs2zACiMV7IBiRE4kBiBA4kROJAYgQOJETiQGIEDiRE4kFgtO5tk1eROI5L03nvvNbZWk9syXXTRRY2ttX379sbWkqSbbrqp0fUWwhEcSIzAgcQIHEiMwIHECBxIjMCBxAgcSIzAgcQIHEisys4mj9o+YvvtJgYCUE6VI/gvJW2oeQ4ANVgw8Ih4XdI/GpgFQGE8BgcSKxY4WxcB3VMscLYuArqHU3Qg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DiXUp8IfbHqBGWe8b96vjOvMYHEB5XTqCAyisE4Hb3mD7Xdv7bN/T9jwl2F5p+1Xb07b32L6z7ZlKsj1ke5ft59uepSTbF9reYXtv72d3Vdsz9aP1U/Tetdb/orkrxsxIekvSpoh4p9XB+mT7YkkXR8RO2xdImpL0/UG/XyfZ/rGkMUlLIuL6tucpxfbjkn4bEVt7Fxo9NyI+bHuuM9WFI/haSfsi4kBEHJf0lKQbW56pbxHxfkTs7L3/saRpSSvanaoM28OSrpO0te1ZSrK9RNLVkh6RpIg4PshxS90IfIWkQ6d8PKMkIZxke0TSaklvtjtJMQ9KulvS520PUtiopFlJj/Uefmy1fV7bQ/WjC4F7ns+leWrf9vmSnpZ0V0R81PY8/bJ9vaQjETHV9iw1OEvSGkkPRcRqSZ9KGujnhLoQ+Iyklad8PCzpcEuzFGX7bM3FvS0islyRdp2kG2wf1NzDqfW2n2h3pGJmJM1ExMkzrR2aC35gdSHwtyRdZvvS3pMaGyU91/JMfbNtzT2Wm46IB9qep5SIuDcihiNiRHM/q1ci4paWxyoiIj6QdMj2qt6nrpE00E+KVrpscp0i4oTt2yW9JGlI0qMRsaflsUpYJ+lWSX+2vbv3uZ9GxAstzoSF3SFpW+9gc0DSbS3P05fWf00GoD5dOEUHUBMCBxIjcCAxAgcSI3AgMQIHEiNwIDECBxL7NyyRs2/TGgiSAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "first_image = data.iloc[0]\n", "np_image = first_image.values\n", "np_image = np_image.reshape(8,8)\n", "\n", "plt.imshow(np_image, cmap='gray_r')" ] }, { "cell_type": "code", "execution_count": 335, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 335, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAADiCAYAAABupy2YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U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yLYesq2LfHtUu3E/Ienqks/nbn+t61zSF2Y2ZWYjbW/mT2TNVup+vmRbV9Z8O5Nt7TMnbZmvZXiM5Xl3v2Zm2yR9aWY/uPvXbW/qLlmzlbqfL9nWlTXfzmRb+x33nKQdSz7fLula5TV75u7Xbv/6s6QJ3fqrXdekzFZKkS/Z1pUy3y5lW7txX5D0tJk9ZWabJL0p6VzlNXtiZg+a2eY7H0t6WdJ37e5qWemyldLkS7Z1pcu3a9lWvVXi7jfN7C1Jn0vqk/Shu39fc80GPCppwsykW/l85O6ftbuleyXNVkqQL9nWlTTfTmXL5CQAJMPkJAAkQ+MGgGRo3ACQDI0bAJKhcQNAMjRuAEiGxg0AydC4ASCZ/wfWh1qXhRUWTwAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "f, axarr = plt.subplots(2, 4)\n", "\n", "axarr[0, 0].imshow(data.iloc[0].values.reshape(8,8), cmap='gray_r')\n", "axarr[0, 1].imshow(data.iloc[99].values.reshape(8,8), cmap='gray_r')\n", "axarr[0, 2].imshow(data.iloc[199].values.reshape(8,8), cmap='gray_r')\n", "axarr[0, 3].imshow(data.iloc[299].values.reshape(8,8), cmap='gray_r')\n", "\n", "axarr[1, 0].imshow(data.iloc[999].values.reshape(8,8), cmap='gray_r')\n", "axarr[1, 1].imshow(data.iloc[1099].values.reshape(8,8), cmap='gray_r')\n", "axarr[1, 2].imshow(data.iloc[1199].values.reshape(8,8), cmap='gray_r')\n", "axarr[1, 3].imshow(data.iloc[1299].values.reshape(8,8), cmap='gray_r')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## K-Nearest Neighbors Model" ] }, { "cell_type": "code", "execution_count": 336, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.9677233358079684" ] }, "execution_count": 336, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.model_selection import KFold\n", "\n", "# 50% Train / test validation\n", "def train_knn(nneighbors, train_features, train_labels):\n", " knn = KNeighborsClassifier(n_neighbors = nneighbors)\n", " knn.fit(train_features, train_labels)\n", " return knn\n", "\n", "def test(model, test_features, test_labels):\n", " predictions = model.predict(test_features)\n", " train_test_df = pd.DataFrame()\n", " train_test_df['correct_label'] = test_labels\n", " train_test_df['predicted_label'] = predictions\n", " overall_accuracy = sum(train_test_df[\"predicted_label\"] == train_test_df[\"correct_label\"])/len(train_test_df) \n", " return overall_accuracy\n", "\n", "def cross_validate(k):\n", " fold_accuracies = []\n", " kf = KFold(n_splits = 4, random_state=2)\n", " for train_index, test_index in kf.split(data):\n", " train_features, test_features = data.loc[train_index], data.loc[test_index]\n", " train_labels, test_labels = labels.loc[train_index], labels.loc[test_index]\n", " model = train_knn(k, train_features, train_labels)\n", " overall_accuracy = test(model, test_features, test_labels)\n", " fold_accuracies.append(overall_accuracy)\n", " return fold_accuracies\n", " \n", "knn_one_accuracies = cross_validate(1)\n", "np.mean(knn_one_accuracies)" ] }, { "cell_type": "code", "execution_count": 337, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 337, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfMAAAEICAYAAABLWh2RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xd8VuX9//HXJ4sZ9pQV9kbFiAwFxQVosYoWpaK4oK5WrbZqt9/a2p+rVdAKqBX3QqVF3CCgMgKIjAgERAgz7D2SfH5/3Cf2No1yG0JO7uT9fDzy4L7PdcbnBMg75zrnvi5zd0RERCR+JYRdgIiIiBwdhbmIiEicU5iLiIjEOYW5iIhInFOYi4iIxDmFuYiISJxTmItIhWZmp5tZdth1iBwNhbnID2Rmq83skJn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PeJ9LFvhDILc0aFOZxLri//DrwvLtPDLuekhB0f04DBoRcSnH1AQYH95pfAvqb2XPhllR87r4++HMz8AaR+4LxJhvIjurteY1IuMezgcB8d98UdiFH4SzgK3fPcffDwESgd8g1FYu7P+nu3d29L5HbuKV2vxwU5nEteGjsSSDT3R8Ku56jYWb1zaxW8LoKkf/kX4ZbVfG4+13u3tTd04h0g37k7nF3tQFgZtWChysJuqXPIdKlGFfcfSOw1szaB4vOBOLuQdFCLiOOu9gDa4CeZlY1+Hl2JpFnf+KOmTUI/mwOXEQp/90klebBygoze5HIHOz1zCwb+IO7PxluVcXSBxgOLAruNQPc7e5vh1hTcTUGngmezk0AXnH3uP5IVznREHgj8nOWJOAFd38n3JKK7Wbg+aB7ehVwVcj1FFtwX/ZsYFTYtRwNd59tZq8B84l0Sy8gfod2fd3M6gKHgRvdfXtpHrxCfjRNRESkPFE3u4iISJxTmIuIiMQ5hbmIiEicU5iLiIjEOYW5iIhInFOYi4iIxDmFuYiISJz7/5P4fwi/gWKcAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "k_values = list(range(1,10))\n", "k_overall_accuracies = []\n", "\n", "for k in k_values:\n", " k_accuracies = cross_validate(k)\n", " k_mean_accuracy = np.mean(k_accuracies)\n", " k_overall_accuracies.append(k_mean_accuracy)\n", " \n", "plt.figure(figsize=(8,4))\n", "plt.title(\"Mean Accuracy vs. k\")\n", "plt.plot(k_values, k_overall_accuracies)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Neural Network With One Hidden Layer" ] }, { "cell_type": "code", "execution_count": 338, "metadata": {}, "outputs": [], "source": [ "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.model_selection import KFold\n", "\n", "# 50% Train / test validation\n", "def train_nn(neuron_arch, train_features, train_labels):\n", " mlp = MLPClassifier(hidden_layer_sizes=neuron_arch)\n", " mlp.fit(train_features, train_labels)\n", " return mlp\n", "\n", "def test(model, test_features, test_labels):\n", " predictions = model.predict(test_features)\n", " train_test_df = pd.DataFrame()\n", " train_test_df['correct_label'] = test_labels\n", " train_test_df['predicted_label'] = predictions\n", " overall_accuracy = sum(train_test_df[\"predicted_label\"] == train_test_df[\"correct_label\"])/len(train_test_df) \n", " return overall_accuracy\n", "\n", "def cross_validate(neuron_arch):\n", " fold_accuracies = []\n", " kf = KFold(n_splits = 4, random_state=2)\n", " for train_index, test_index in kf.split(data):\n", " train_features, test_features = data.loc[train_index], data.loc[test_index]\n", " train_labels, test_labels = labels.loc[train_index], labels.loc[test_index]\n", " \n", " model = train_nn(neuron_arch, train_features, train_labels)\n", " overall_accuracy = test(model, test_features, test_labels)\n", " fold_accuracies.append(overall_accuracy)\n", " return fold_accuracies" ] }, { "cell_type": "code", "execution_count": 339, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/srinify/anaconda/envs/dq/lib/python3.6/site-packages/sklearn/neural_network/multilayer_perceptron.py:564: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n" ] }, { "data": { "text/plain": [ "[]" ] }, "execution_count": 339, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAe0AAAEICAYAAAByPazKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xt8XHWd//HXO0mTtE3SQO+lQAsU1qJY3S643mABEVgVL6vCioK6y+4q/rygv5/68+EF18Xdn+JlRfeHKyviBVnUlZ+yIiLo6qJSvKCAQAGhpUmbtjRJ20yay+f3xzmTnkySdtKmmTmZ9/PxmEdmzjkz853vnMl7vt/zPd9RRGBmZmbVr67SBTAzM7PyOLTNzMxywqFtZmaWEw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PkyUb15H528S9Ou22syh2dcj/shaQXwDODneH88YCX1CDnZH/MS2hpnmc9VK99zIuKZJF1mb5b0/EoXaAbyPjo5nwOOBdYAHcDH0+Wux32Q1AJ8A3hbRPTsa9NxlrkeU+PUY272x7yE9kbgyMzt5cCmCpUldyJiU/p3C/Atku6dzcXusvTvlsqVMFcmqjfvo5MQEZsjYigihoHPs7fL0fU4AUmzSILmKxHxzXSx98dJGq8e87Q/5iW07wJWSVopqZFkYMBNFS5TLkiaK6m1eB04C/gdSf1dlG52EfDtypQwdyaqt5uA16Wjdp8FdBe7LW2skuOrLyPZJyGpx/MlNUlaSTKQ6hfTXb5qI0nAF4D7I+LKzCrvj5MwUT3maX9sqOSTlysiBiVdCtwC1APXRMS9FS5WXiwGvpXsqzQAX42I70m6C7hB0huBx4FXVrCMVUnS14DTgAWSNgIfAD7K+PV2M3AuyUCV3cDrp73AVWqCejxN0hqSrsY/AH8DEBH3SroBuI9kpO+bI2KoEuWuMs8BXgv8VtKv02XvxfvjZE1UjxfkZX/0NKZmZmY5kZfucTMzs5rn0DYzM8sJh7aZmVlOOLTNzMxywqFtZmaWEw5tMzOznHBom5mZ5cT/By0S9NHHMwALAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "nn_one_neurons = [\n", " (8,),\n", " (16,),\n", " (32,),\n", " (64,),\n", " (128,),\n", " (256,)\n", "]\n", "nn_one_accuracies = []\n", "\n", "for n in nn_one_neurons:\n", " nn_accuracies = cross_validate(n)\n", " nn_mean_accuracy = np.mean(nn_accuracies)\n", " nn_one_accuracies.append(nn_mean_accuracy)\n", "\n", "plt.figure(figsize=(8,4))\n", "plt.title(\"Mean Accuracy vs. Neurons In Single Hidden Layer\")\n", "\n", "x = [i[0] for i in nn_one_neurons]\n", "plt.plot(x, nn_one_accuracies)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Summary:\n", "\n", "It looks like adding more neurons to the single hidden layer helped massively improved simple accuracy from approximately `86%` to approximately `94%`. Simple accuracy computes the number of correct classifications the model made, but doesn't tell us anything about false or true positives or false or true negatives.\n", "\n", "Given that k-nearest neighbors achieved approximately `96%` accuracy, there doesn't seem to be any advantages to using a single hidden layer neural network for this problem." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Neural Network With Two Hidden Layers" ] }, { "cell_type": "code", "execution_count": 340, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 340, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfMAAAEICAYAAABLWh2RAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3XecVPW5x/HPF5DOgnTpqKhgQ1ixxWA0XksSjZKbiP3GiDVdbzTmpug1amKaUaMk8d5gQ43GGGOi14KmWRYUEBFEVHqXJnXZ5/5xzuhh2GWHpczO7vf9es1rT/nNmec3ZZ/5lXNGEYGZmZmVribFDsDMzMy2j5O5mZlZiXMyNzMzK3FO5mZmZiXOydzMzKzEOZmbmZmVOCdzM7MdRNLbko6oYd+JkmZs5b5jJX1n50VnDZmTeQMk6V1JGyR1ztv+mqSQ1K9IcfWXVCXp9mI8fqmSdEz6ut2Wt/3vks4vUljbLa3XnDrc7yxJq9Pb2vQ9lVtfvTNiTR93gaSP5W27WNLTufWI2Csi/rWzYqiL/BitYXIyb7jeAUbmViQdCLQqXjgAnAu8D5whqcWufGBJzXbl4+0EHwDn7oovYvX9uYqIeyOibUS0BU4C5uXW021Wj0hqIsm5ZifzE9xw3U2SPHPOA8ZkC0hqIelmSbMkLZR0h6RW6b7dJT0uabGk99PlXpn7jpN0naR/SFol6an8noBqnAt8B9gIfCYvlv0l/Z+kZWks3063N5X07bT7cpWk8ZJ6S+qX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+v8DFeWVL5TX6GEn366TM++zkUv48baVOJft52kqdSu7z5Mu5mpmZlTh3s5uZmZU4J3MzM7MS52RuZmZW4pzMzczMSpyTuZmZWYlzMjczMytxTuZmZmYl7v8BD+EZLdBa3H4AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "nn_two_neurons = [\n", " (64,64),\n", " (128, 128),\n", " (256, 256)\n", "]\n", "nn_two_accuracies = []\n", "\n", "for n in nn_two_neurons:\n", " nn_accuracies = cross_validate(n)\n", " nn_mean_accuracy = np.mean(nn_accuracies)\n", " nn_two_accuracies.append(nn_mean_accuracy)\n", "\n", "plt.figure(figsize=(8,4))\n", "plt.title(\"Mean Accuracy vs. Neurons In Two Hidden Layers\")\n", "\n", "x = [i[0] for i in nn_two_neurons]\n", "plt.plot(x, nn_two_accuracies)" ] }, { "cell_type": "code", "execution_count": 341, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.9382318732986884, 0.9510257362039098, 0.9532467211086364]" ] }, "execution_count": 341, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nn_two_accuracies" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Summary\n", "\n", "Using 2 hidden layers improved our simple accuracy to `95%`. While I'd traditionally be worried about overfitting, using 4-fold cross validation also gives me a bit more assurance that the model is generalizing to achieve the extra `1%` in simple accuracy over the single hidden layer networks we tried earlier." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Neural Network With Three Hidden Layers" ] }, { "cell_type": "code", "execution_count": 342, "metadata": {}, "outputs": [], "source": [ "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.model_selection import KFold\n", "\n", "# 50% Train / test validation\n", "def train_nn(neuron_arch, train_features, train_labels):\n", " mlp = MLPClassifier(hidden_layer_sizes=neuron_arch)\n", " mlp.fit(train_features, train_labels)\n", " return mlp\n", "\n", "def test(model, test_features, test_labels):\n", " predictions = model.predict(test_features)\n", " train_test_df = pd.DataFrame()\n", " train_test_df['correct_label'] = test_labels\n", " train_test_df['predicted_label'] = predictions\n", " overall_accuracy = sum(train_test_df[\"predicted_label\"] == train_test_df[\"correct_label\"])/len(train_test_df) \n", " return overall_accuracy\n", "\n", "def cross_validate_six(neuron_arch):\n", " fold_accuracies = []\n", " kf = KFold(n_splits = 6, random_state=2)\n", " for train_index, test_index in kf.split(data):\n", " train_features, test_features = data.loc[train_index], data.loc[test_index]\n", " train_labels, test_labels = labels.loc[train_index], labels.loc[test_index]\n", " \n", " model = train_nn(neuron_arch, train_features, train_labels)\n", " overall_accuracy = test(model, test_features, test_labels)\n", " fold_accuracies.append(overall_accuracy)\n", " return fold_accuracies" ] }, { "cell_type": "code", "execution_count": 343, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/srinify/anaconda/envs/dq/lib/python3.6/site-packages/sklearn/neural_network/multilayer_perceptron.py:564: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n" ] }, { "data": { "text/plain": [ "[]" ] }, "execution_count": 343, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAe0AAAEICAYAAAByPazKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAIABJREFUeJzt3Xl8VPW9//HXJ4FAIAlbQhIIqywBxQUCqNRqtVa0KhVqFZeKomjVLl7t76q1txZvS3trW9urdalSFq2ItirXaq3iUhdsGZRFVllEwmbYw06Sz++PcwLDEMwASSaTvJ+PRx6Zc853Zj7znTPzmfM9n3OOuTsiIiJS/6UkOgARERGJj5K2iIhIklDSFhERSRJK2iIiIklCSVtERCRJKGmLiIgkCSVtEan3zOxTM/tqouM4HDN7xMx+/AXL3cx6HG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vZgGfDusIj8V2Fo5jN7QmdlQ4D+Bi919Z9SiacDlZtbMzLoRFOn9OxEx1jSdEa2WmNmXgHeAeRzYh3s3wX7tqUBngi+oS909tuCkQTOzs4A73P1CM+tOsOXdFvgIuMrd9yQyvrpkZicTFOalAcuBawl+TDfadcTMfgpcRjDc+RFwPcH+yEaznpjZ08BZBJebXA/8BHiBKtaL8MfNgwRV0juBa909koi4a9Nh+uQuoBmwMWz2gbvfFLb/EcF+7jKC3ZOvxD5mMlLSFhERSRIaHhcREUkSStoiIiJJQklbREQkSShpi4iIJAklbRERkSShpC0iIpIklLRFRESSxP8Hbs/FZhMk7KQAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "nn_three_neurons = [\n", " (10, 10, 10),\n", " (64, 64, 64),\n", " (128, 128, 128)\n", "]\n", "\n", "nn_three_accuracies = []\n", "\n", "for n in nn_three_neurons:\n", " nn_accuracies = cross_validate_six(n)\n", " nn_mean_accuracy = np.mean(nn_accuracies)\n", " nn_three_accuracies.append(nn_mean_accuracy)\n", "\n", "plt.figure(figsize=(8,4))\n", "plt.title(\"Mean Accuracy vs. Neurons In Three Hidden Layers\")\n", "\n", "x = [i[0] for i in nn_three_neurons]\n", "plt.plot(x, nn_three_accuracies)" ] }, { "cell_type": "code", "execution_count": 324, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.8870401337792643, 0.947699739873653, 0.960479375696767]" ] }, "execution_count": 324, "metadata": {}, "output_type": "execute_result" } ], "source": [ "nn_three_accuracies" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Summary\n", "\n", "Using 3 hidden layers improved our simple accuracy to `96%`, even with 6-fold cross validation. This seems to be in line with the research literature out there about deep neural networks for computer vision. Having more layers and more neurons tends to improve the network's performance." ] } ], "metadata": { "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.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }