{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Working With Image Data" ] }, { "cell_type": "code", "execution_count": 1, "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": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['data', 'target', 'target_names', 'images', 'DESCR'])" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "digits_data.keys()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "labels = pd.Series(digits_data['target'])" ] }, { "cell_type": "code", "execution_count": 4, "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": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = pd.DataFrame(digits_data['data'])\n", "data.head(1)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPUAAAD4CAYAAAA0L6C7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAKt0lEQVR4nO3dXYhc9RnH8d+vq9L6EoxNKJINXRckIIWauAQkIDR2S6yivaiSgEKl4E0VpQWjveud3oi9KIJErWCqZKOCiNUKKq3QWneS2BpXSxJTMlWbhEZ8KTREn17sBKJd3TNnzts+/X5gcV+G/T/D5uuZmT17/o4IAcjjK20PAKBaRA0kQ9RAMkQNJEPUQDKn1fFNV6xYERMTE3V861YdO3as0fX6/X5jay1btqyxtcbHxxtba2xsrLG1mnTw4EEdPXrUC32tlqgnJiY0Oztbx7du1czMTKPrbd26tbG1pqenG1vrrrvuamyt5cuXN7ZWk6ampr7wazz8BpIhaiAZogaSIWogGaIGkiFqIBmiBpIhaiAZogaSKRS17U2237K9z/YddQ8FoLxFo7Y9JulXkq6QdJGkLbYvqnswAOUUOVKvl7QvIg5ExHFJj0m6pt6xAJRVJOpVkg6d8nF/8LnPsH2T7Vnbs0eOHKlqPgBDKhL1Qn/e9T9XK4yI+yNiKiKmVq5cOfpkAEopEnVf0upTPh6X9E494wAYVZGoX5V0oe0LbJ8habOkp+odC0BZi14kISJO2L5Z0nOSxiQ9GBF7a58MQCmFrnwSEc9IeqbmWQBUgDPKgGSIGkiGqIFkiBpIhqiBZIgaSIaogWRq2aEjqyZ3zJCkt99+u7G1mtxS6LzzzmtsrR07djS2liRde+21ja63EI7UQDJEDSRD1EAyRA0kQ9RAMkQNJEPUQDJEDSRD1EAyRA0kU2SHjgdtH7b9ehMDARhNkSP1ryVtqnkOABVZNOqI+L2kfzUwC4AKVPacmm13gG6oLGq23QG6gVe/gWSIGkimyK+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atsv2p6zvdf2rW3PVCXbY7Z323667VmqZPtc2zttvzn42V3a9kzDav059WCDgL9p/nJJfUmvStoSEW+0OtiIbJ8v6fyI2GX7HEk9ST9Y6vfrJNs/lTQlaVlEXNX2PFWx/bCkP0TEtsEVdM+MiPfbnmsYXThSr5e0LyIORMRxSY9JuqblmUYWEe9GxK7B+x9KmpO0qt2pqmF7XNKVkra1PUuVbC+TdJmkByQpIo4vtaClbkS9StKhUz7uK8k//pNsT0haK+mVdiepzL2Sbpf0aduDVGxS0hFJDw2eWmyzfVbbQw2rC1F7gc+l+T2b7bMlPS7ptoj4oO15RmX7KkmHI6LX9iw1OE3SOkn3RcRaSR9LWnKv8XQh6r6k1ad8PC7pnZZmqZTt0zUf9PaIyHJ55Q2SrrZ9UPNPlTbafqTdkSrTl9SPiJOPqHZqPvIlpQtRvyrpQtsXDF6Y2CzpqZZnGplta/652VxE3NP2PFWJiDsjYjwiJjT/s3ohIq5veaxKRMR7kg7ZXjP41OWSltwLm4Wu+12niDhh+2ZJz0kak/RgROxteawqbJB0g6S/2t4z+NzPI+KZFmfC4m6RtH1wgDkg6caW5xla67/SAlCtLjz8BlAhogaSIWogGaIGkiFqIBmiBpIhaiCZ/wLr8rHX1UUh+gAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAADeCAYAAAAU9Eo0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA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Xvt0m6VvjMvrn7tVu//iRpWr//VS2bTmYrdSJfsi2rk/m2mW3pQX1B0lNm9qSZbZL0pqRzhc/si5k9YGabb38s6WVJ37bb1bo6l63UmXzJtqzO5dt2tkXf+nD3m2b2lqQvJA1J+sjdvyt5Zg0elTRtZtLv+Xzs7p+329KdOpqt1IF8ybasjubbaraskANAcmwmAkByDGoASI5BDQDJMagBIDkGNQAkx6AGgOQY1ACQ3P8BiQhKWaxLIVAAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.9677233358079684" ] }, "execution_count": 7, "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": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfAAAAEICAYAAACgbaaSAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dd3xW5f3/8dcnCWGGPWWFvVExMmWIC9BiFa1KRXFBXa1abdVuv7W1P1erqBVQ696otIobBFRGAJERgYAIYYa9R5LP74/7pL2bBrkJSU7u5P18PPLgvs91xucEyDvnOue+LnN3REREJL4khF2AiIiIHDsFuIiISBxSgIuIiMQhBbiIiEgcUoCLiIjEIQW4iIhIHFKAi0iFZmaDzCwr7DpEjpUCXOQYmdlqMztkZvULLP/KzNzMUkOqq5WZ5ZnZ42EcX0RKlwJcpGi+BS7Lf2Nm3YCq4ZUDwBXAduBSM6tcmgc2s6TSPJ6IKMBFiup5IoGZ70rguegVzKyymT1gZmvMbJOZ/d3MqgZtdczsX2aWbWbbg9fNoradZ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L/sb8Jt6qicfe73L1ZMNf9pcCn7h53VxUAZlY9eECSoMv5bCLdhXHF3TcCa82sQ7DoDCDuHvYs4DLiuPs8sAbobWbVgp9nZxB5lifumFnD4M8WwIWUwt9NUkkfoCwys5eJzGFe38yygN+5+1PhVlUk/YBRwKLg3jHA3e7+Xog1FVUT4NngqdoEIvPOx/XHr8qJRsBbkZ+tJAEvufv74ZZUZDcDLwZdz6uAq0Kup8iC+6xnAWPDruV4uPtsM3sDmE+ky3kB8Tus6ptmVg84DNzo7ttL+oAV8mNkIiIi8U5d6CIiInFIAS4iIhKHFOAiIiJxSAEuIiIShxTgIiIicUgBLiIiEocU4CIiInHo/wNOb38IXEbXGQAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 11, "metadata": {}, "outputs": [], "source": [ "from sklearn.neighbors import KNeighborsClassifier\n", "from sklearn.model_selection import KFold\n", "from sklearn.neural_network import MLPClassifier\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": 12, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: 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": 12, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAEICAYAAACQ4bezAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5RdZX3/8fdnJplcJxeSyT0kAUIgQLgYoUgVKggJRhFYWqIgWCutgr/Wij+hstBiEdufVm0Fu2hL5WYporYYIlQRvNQbQchACIFwTZgzySQhM7lNJjPz/f2x94Sdk5nJmWSSc86cz2utWbMvz97nu5+zz/nu59mXo4jAzMzMSlNVsQMwMzOznjlRm5mZlTAnajMzsxLmRG1mZlbCnKjNzMxKmBO1mZlZCXOiNrOyIelHki7vh/XMlBSSBvVHXN2s/68l/Wsv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SuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfYAAAEICAYAAACtc9bVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXxV1bn/8c+TBAIhISRMMiZMyiggAUXrUIdWbasV1OtYsba2er1tHfpTW2t7ba1zra3a1ra02mtV0FZxaLUyOLUKQQmggswkgIAkjGFK8vz+2DvxcEzghCE75+T7fr3OK3uvvc8+zzpDnr3W2oO5OyIiIpIa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XiIYC98HlAUdfyNqNNignGyOeHjt+G644H3CY56fRf4StTxN6JODX7XgB+Gn9NC4Iyo40+0TmH5n4Fvx63b7D8n4HMEXbRzY75nZybz72kvdUra39Ne6pQUvyddUlZERCSFqCteREQkhSixi4iIpBAldhERkRSixC4iIpJClNhFRERSiBK7iIhIClFiFxERSSH/H7RUj3/7FaXJAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.9398861667903984, 0.9571492204899779, 0.9515837663944569]" ] }, "execution_count": 14, "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": 15, "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": 16, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.\n", " % self.max_iter, ConvergenceWarning)\n", "/home/yunoac/anaconda3/lib/python3.7/site-packages/sklearn/neural_network/multilayer_perceptron.py:566: 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": 16, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAEICAYAAACQ4bezAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3deXxU9fX/8dchEJYkbCFB2ZdEEBURA4patS6V1h2tdYcg4lLb2tpNu9f6tYttbX91qVUBV6RWrdpqtS61WpUEcQNENoWAkLAnQMh2fn/cmzAMCQRIcieZ9/PxyCMz996ZOfOZO/Oe+5n7udfcHREREUlM7aIuQERERBqmoBYREUlgCmoREZEEpqAWERFJYApqERGRBKagFhERSWAKahFJeGb2iZmdEnUdDTGzu83sR7uZ72aW08C8SWb2evNVJ62dgroVCD+kKsysV9z0d8MPgEER1TXYzGrM7M4oHr+1MrMTw9ftjrjpr5vZpIjK2m/h8yrah9tdYmZl4d+2cJ2qvV7WHLXuZX3TzewXcdMGha9hewB3v9rdb46mwvrF1yitl4K69VgGXFR7xcwOAzpHVw4AlwMbgAvNrGNLPnAb+PDZAlzeEl+yEr2t3P1hd09393Tgi8Cq2uvhtL2S6M83mei1aBoK6tbjQYJgrDUReCB2ATPraGa3mdlyM1sTdsd1Duf1MLNnzazEzDaEl/vF3PZVM7vZzN4ws1IzeyF+C74elwM/BCqBM+NqOcTMXjSz9WEtN4XTU8zsJjNbEj7OHDPrX9+3/7CmKeHl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ARS7+5zYyfUsmkzjBdsDo4G73P0IYAtJ1M1dn/B317OBwUAfII2gazdeMq0ne5Ls7yPM7AcEPzc+XDupnsVabZsoqJuRmXUgCOmH3f2JcPKa2m6p8H9xVPW1sGOBs8zsE2AmQVfm7QTddO3DZfoBq6IpLxJFQJG7vx1ef5wguJN1HQE4BVjm7iXuXgk8ARxDcq8ntRpaL4qA/jHLJVX7mNlE4AzgEt9xYJA21SYK6mYS/v56H7DA3X8XM+tpYGJ4eSLw95auLQrufqO793P3QQQ7ebzs7pcArwDnh4slTXsAuPtqYIWZDQsnnQzMJ0nXkdBy4Ggz6xK+h2rbJGnXkxgNrRdPA5eHe38fDWyq7SJv68xsPPA94Cx33xoz62ngQjPraGaDCXa0mx1FjU1BRyZrJmZ2HPBf4AN2/CZ7E8Hv1LOAAQQfSl929/idRto0MzsR+La7n2FmQwi2sHsCc4FL3X17lPW1JDMbRbBzXSqwFMgn+AKdtOuImf0M+ApBV+ZcYArB74tJs56Y2aPAiQSnblwD/AR4inrWi/ALzZ8I9m7eCuS7e2EUdTenBtrkRqAjsC5c7C13vzpc/gcEv1tXEfz0+Fz8fbYWCmoREZEEpq5vERGRBKagFhERSWAKahERkQSmoBYREUlgCmoREZEEpqAWERFJYApqERGRBPb/AfokUsgCBnAbAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "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": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.9154124860646601, 0.950479375696767, 0.9582552954292085]" ] }, "execution_count": 17, "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.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }