{ "metadata": { "name": "", "signature": "sha256:1cef4e5868f3307029713a5e8b00de90db2eb3cff529c981aadc53662b2a3f36" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Probabilistic Interpretations of Regression\n", "\n", "# Gaussian Process Summer School, Melbourne, Australia\n", "### 25th-27th February 2015\n", "### Neil D. Lawrence\n", "\n", "\n", "### Overdetermined Systems\n", "\n", "We motivated the introduction of probability by considering systems where there were more observations than unknowns. In particular we thought about the simple fitting of the gradient and an offset of a line,\n", "\n", "$$y= mx +c$$\n", "\n", "and what happens if we have three pairs of observations of $x$ and $y$, $\\{x_i, y_i\\}_{i=1}^3$. We solved this issue by introducing a type of [slack variable](http://en.wikipedia.org/wiki/Slack_variable), $\\epsilon_i$, known as noise, such that for each observation we had the equation,\n", "\n", "$$y_i = mx_i + c + \\epsilon_i.$$\n", "\n", "The slack variable represented the difference between our actual prediction and the true observation. This is also known as the *residual*. By introducing the slack variable we now have an additional $n$ variables to estimate, one for each data point, $\\{\\epsilon_i\\}$. This actually turns the overdetermined system into an underdetermined system. Introduction of $n$ variables, plus the original $m$ and $c$ gives us $n+2$ parameters to be estimated from $n$ observations, which actually makes the system *underdetermined*. However, we then made a probabilistic assumption about the slack variables, we assumed that the slack variables were distributed according to a probability density. And for the moment we have been assuming that density was the Gaussian,\n", "\n", "$$\\epsilon_i \\sim \\mathcal{N}(0, \\sigma^2),$$\n", "\n", "with zero mean and variance $\\sigma^2$. \n", "\n", "#### Sum of Squares and Probability\n", "\n", "In the overdetermined system we introduced a new set of slack variables, $\\{\\epsilon_i\\}_{i=1}^n$, on top of our parameters $m$ and $c$. We deal with the variables by placing a probability distribution over them. This gives rise to the likelihood and for the case of Gaussian distributed variables, it gives rise to the sum of squares error. It was Gauss who first made this connection in his volume on \"Theoria Motus Corprum Coelestium\" (written in Latin)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import pods\n", "pods.notebook.display_google_book(id='ORUOAAAAQAAJ', page='213')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "/Users/neil/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pytz/__init__.py:29: UserWarning: Module pods was already imported from /Users/neil/sods/ods/pods/__init__.pyc, but /Users/neil/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages is being added to sys.path\n", " from pkg_resources import resource_stream\n" ] }, { "html": [ "" ], "metadata": {}, "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The relevant section roughly translates as\n", "\n", "... It is clear, that for the product $\\Omega = h^\\mu \\pi ^{-frac{1}{2}\\mu} e^{-hh(vv + v^\\prime v^\\prime + v^{\\prime\\prime} v^{\\prime\\prime} + \\dots)}$ to be maximised the sum $vv + v ^\\prime v^\\prime + v^{\\prime\\prime} v^{\\prime\\prime} + \\text{etc}.$ ought to be minimized. *Therefore, the most probable values of the unknown quantities $p , q, r , s \\text{etc}.$, should be that in which the sum of the squares of the differences between the functions $V, V^\\prime, V^{\\prime\\prime} \\text{etc}$, and the observed values is minimized*, for all observations of the same degree of precision is presumed.\n", "\n", "It's on the strength of this paragraph that the density is known as the Gaussian, despite the fact that four pages later Gauss credits the necessary integral for the density to Laplace, and it was also Laplace that did a lot of the original work on dealing with these errors through probability. [Stephen Stigler's book on the measurement of uncertainty before 1900](http://www.hup.harvard.edu/catalog.php?isbn=9780674403413) has a nice chapter on this." ] }, { "cell_type": "code", "collapsed": false, "input": [ "pods.notebook.display_google_book(id='ORUOAAAAQAAJ', page='217')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "display_data", "text": [ "" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import pods\n", "from IPython.display import display" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here numpy gives us the numerical array facility, matplotlib is for plotting and pods is a python open data science library which provides some convenient access to a range of data sets.\n", "\n", "## Iterative Solution\n", "\n", "Now we will code linear regression in python. We will do it in two ways, once using iterative updates (coordinate ascent) and then using linear algebra. \n", "For this part we are going to load in some data, we will use the example from the Olympics: the pace of Marathon winners. To load in the data we are going to use the pods library, an 'open data science' library for access to a range of data sets and with other facilities." ] }, { "cell_type": "code", "collapsed": true, "input": [ "data = pods.datasets.olympic_marathon_men()\n", "x = data['X']\n", "y = data['Y']" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can see what these values are by typing:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "print(x)\n", "print(y)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[ 1896.]\n", " [ 1900.]\n", " [ 1904.]\n", " [ 1908.]\n", " [ 1912.]\n", " [ 1920.]\n", " [ 1924.]\n", " [ 1928.]\n", " [ 1932.]\n", " [ 1936.]\n", " [ 1948.]\n", " [ 1952.]\n", " [ 1956.]\n", " [ 1960.]\n", " [ 1964.]\n", " [ 1968.]\n", " [ 1972.]\n", " [ 1976.]\n", " [ 1980.]\n", " [ 1984.]\n", " [ 1988.]\n", " [ 1992.]\n", " [ 1996.]\n", " [ 2000.]\n", " [ 2004.]\n", " [ 2008.]\n", " [ 2012.]]\n", "[[ 4.47083333]\n", " [ 4.46472926]\n", " [ 5.22208333]\n", " [ 4.15467867]\n", " [ 3.90331675]\n", " [ 3.56951267]\n", " [ 3.82454477]\n", " [ 3.62483707]\n", " [ 3.59284275]\n", " [ 3.53880792]\n", " [ 3.67010309]\n", " [ 3.39029111]\n", " [ 3.43642612]\n", " [ 3.20583007]\n", " [ 3.13275665]\n", " [ 3.32819844]\n", " [ 3.13583758]\n", " [ 3.0789588 ]\n", " [ 3.10581822]\n", " [ 3.06552909]\n", " [ 3.09357349]\n", " [ 3.16111704]\n", " [ 3.14255244]\n", " [ 3.08527867]\n", " [ 3.10265829]\n", " [ 2.99877553]\n", " [ 3.03392977]]\n" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting the Data\n", "\n", "And you can make a plot of $y$ vs $x$ with the following command:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "plt.plot(x, y, 'rx')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "[]" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFFRJREFUeJzt3X+s5Xdd5/HnqwzaH6JXAxmQGTKTSBNL1HarQ9NBe9as\naGe0ugGTZldgMXEnoIEoVF3KpuPGQWLX0CVxoQluwu4a1g2VLjCzS/l1ujDB1sq0FMYCDXdi2y3F\npL0g1kRq3/vH+d72zJ3745y533vP99zv85Hc3O/5fj/3nPe9ud/X+Z7391eqCknSznfBrAuQJG0P\nA1+SesLAl6SeMPAlqScMfEnqCQNfknpi1ySDkpwBvgX8E/CdqjqwYvkA+F/A15pZt1XV77dXpiRp\nsyYKfKCAQVU9vs6YO6vquhZqkiRtgWlaOtnkcknSDE0a+AV8Isk9SX5tjeVXJ7kvyYkkl7VXoiSp\nDZO2dA5W1aNJXgB8PMkDVfWZseWfB/ZW1ZNJrgVuBy5tu1hJ0vnLtNfSSXIT8O2q+qN1xiwCV473\n/JN40R5JOg9V1UrLfMOWTpKLkzyvmb4EeCVw/4oxu5OkmT7A6I3knB28VTW3XzfddNPMa+hr/fNc\nu/XP/mve62/TJC2d3cCHmjzfBfxpVd2R5EgT4rcCrwbekOQp4Eng+larlCRt2oaBX1WLwOWrzL91\nbPqPgT9utzRJUps803ZCg8Fg1iVsyjzXP8+1g/XP2rzX36apd9qe9wsltV2vJUk7RRJqu3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Tlt/m+uvJ15JUk94i0NJ6gkD\nX5J6wsCXpJ4w8CWpJwx8SeoJA1+SesLAl6SeMPAlqSf+P7P3QdRZ9dimAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Maximum Likelihood: Iterative Solution\n", "\n", "Now we are going to fit a line, $y_i=mx_i + c$, to the data you've plotted. We are trying to minimize the error function:\n", "\n", "$$E(m, c, \\sigma^2) = \\frac{n}{2} \\log \\sigma^2 + \\frac{1}{2\\sigma^2} \\sum_{i=1}^n(y_i-mx_i-c)^2$$\n", "\n", "with respect to $m$, $c$ and $\\sigma^2$. We can start with an initial guess for $m$, " ] }, { "cell_type": "code", "collapsed": true, "input": [ "m = -0.4\n", "c = 80" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then we use the maximum likelihood update, derived in the lecture, to find an estimate for the offset, $c$,\n", "\n", "$$c^* = \\frac{\\sum_{i=1}^n(y_i-m^*x_i)}{n}$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "c = (y - m*x).mean()\n", "print c" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "786.019771145\n" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": {}, "source": [ "And now we can make an estimate for the gradient of the line,\n", "\n", "$$m^* = \\frac{\\sum_{i=1}^n ((y_i - c)*x_i))}{\\sum_{i=1}^n x_i^2}$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "m = ((y - c)*x).sum()/(x**2).sum()\n", "print m" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-0.3998724073\n" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can have a look at how good our fit is by computing the prediction across the input space. First create a vector of 'test points'," ] }, { "cell_type": "code", "collapsed": false, "input": [ "x_test = np.linspace(1890, 2020, 130)[:, None]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now use this vector to compute some test predictions," ] }, { "cell_type": "code", "collapsed": false, "input": [ "f_test = m*x_test + c" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 11 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now plot those test predictions with a blue line on the same plot as the data," ] }, { "cell_type": "code", "collapsed": false, "input": [ "plt.plot(x_test, f_test, 'b-')\n", "plt.plot(x, y, 'rx')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 12, "text": [ "[]" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEACAYAAAC6d6FnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHe1JREFUeJzt3XuUFPWZ//H3AwPilQFU7qyoA4o3FCUq+rO9hngDYwxq\nohgvSSR74ibGCJgcJxcFYc1u1DXuqtmQZOM1RsErxLXVuAqa5T7AjAlsxAjGOESJZkXn+f3xrZZm\nlsvMdPVUddfndc6cqarurnqYQ/fTVfX9VJm7IyIi2dMl6QJERCQZagAiIhmlBiAiklFqACIiGaUG\nICKSUWoAIiIZFUsDMLOuZrbQzOZE873NbJ6ZNZrZXDOrjWM7IiISn7j2AK4CGoBCqGAyMM/dhwFP\nR/MiIpIiJTcAMxsEnA7cBVi0+GxgVjQ9Cxhf6nZERCRecewB/BNwDdBStKyvu6+PptcDfWPYjoiI\nxKikBmBmZwJvuvtCNn/734KHa03oehMiIilTU+LrjwXONrPTgR7AHmb2M2C9mfVz93Vm1h94s/UL\nzUxNQUSkA9x9q1+426ukPQB3n+rug919KHA+8J/ufhEwG5gYPW0i8PA2Xl+xP9dff33iNaj+5OtQ\n/ZX3U8m1u8f7vTnuHEChuunAqWbWCJwUzYuISIqUegjoY+7+LPBsNP02cEpc6xYRkfgpCdxBuVwu\n6RJ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f/zWKA34eR1IzAXqC16TWrev+2tP873r4JgIiIZVXU3ahERkbZR\nAxARySg1ABGRjFIDEBHJKDUAEZGMUgMQEckoNQARkYxSAxARyaj/D10ke1Zz54oLAAAAAElFTkSu\nQmCC\n", "text": [ "" ] } ], "prompt_number": 12 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The fit isn't very good, we need to iterate between these parameter updates in a loop to improve the fit, we have to do this several times," ] }, { "cell_type": "code", "collapsed": false, "input": [ "for i in np.arange(10):\n", " m = ((y - c)*x).sum()/(x*x).sum()\n", " c = (y-m*x).sum()/y.shape[0]\n", "print(m)\n", "print(c)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "-0.398725964251\n", "783.527379727\n" ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "metadata": {}, "source": [ "And let's try plotting the result again" ] }, { "cell_type": "code", "collapsed": false, "input": [ "f_test = m*x_test + c\n", "plt.plot(x_test, f_test, 'b-')\n", "plt.plot(x, y, 'rx')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 14, "text": [ "[]" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEACAYAAAC6d6FnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH2lJREFUeJzt3XuUFNW59/HvwwBJXnWJoIeLSsAjykUQBoJjkNh4ARQv\nYDwh+mqMLnyNAyJe4jUuxrjMQfBuBPXEHIlJeEMOCeIViTJqiAExXB1QNHCO8gbUCCoCivC8f+wa\nHccBe6arp6q7f5+1ZlFd1V31MND99H527b3N3RERkdLTIukAREQkGUoAIiIlSglARKREKQGIiJQo\nJQARkRKlBCAiUqJySgBm9nUzW2hmS82sxsz+Pdrf1szmmdlrZva0mbWJJ1wREYmL5ToOwMz+l7tv\nNbOWwJ+BK4HTgHfdfbKZXQ3s5+7X5B6uiIjEJecSkLtvjTZbA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zsCHQFrjSzrs0QT2NcAFSa2WJC\n0+yThONprD3Gb2a9gEnARQnElo3dxV8F3OHuW4E03068u/hbAscAZ0d/jjKz40jfgMkG40/rezf6\nYjALuNS/OFUNHmoiafv9fkFj44/j/ZvTVBBZGujuJ0Tb/wX8Itr+NvBHd98JvGNmC4D+wJ+Bg+q8\n/iA+Lxs1K3d/FRgGYGaHASOiQ+v54rfpgwiZdz0piR32GD9mdhDwB+Bcd18b7U57/CdHhwYC3zWz\nyYSy4i4z20b4+6Q5/trf/5vA8+7+XnTsCaAc+DXpjr/295+6966ZtSJ8eD7s7rOj3RvNrIO7b4jK\nI29H+1P3/m1k/LG9f5ujBfC6mR0bbR8HvBZtr44eY2Z7ARXA6qi29YGZHWVmRphraDYJMLMDoj9b\nAD8BpkWH5gDfN7PW0TefbsCiNMUOu48/upvgceBqd3+x9vnu/g/SHf99UZzfcfeu7t6VMAXJze4+\ntVB+/8BcoLeZfcPMWgLHAq8UQPz3RYdS9d6NrvUgUOPudaekmQOcF22fVyeWVL1/Gxt/rO/fmHuz\nZwD/j9BUfJNw58AAQj1rKfAi0C967tcI33hWAK/wxTs5+kf7XwfujjPGRsR+ATCe0CP/KvCzes+/\nLopvNdFdTknF3tj4CW/mLYTR27U/+xdK/PVeNxG4vJB+/9Hz/zewMop1UiHFn8L37jHArugzpvb/\n83CgLaHz+jXgaaBNndek5v3b2PjjfP9qIJiISIkquoVaREQkO0oAIiIlSglARKREKQGIiJQoJQAR\nkRKlBCAiUqKUAERESpQSgIhIifr/WBTxqw6qEjoAAAAASUVORK5CYII=\n", "text": [ "" ] } ], "prompt_number": 14 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Clearly we need more iterations than 10! \n", "\n", "Try add more iterations above to try and get closer to the solution.\n", "\n", "## Direct Solution with Linear Algebra\n", "\n", "Hopefully, you are now persuaded of the merits of solving the entire system, simultaneously, using linear algebra. To do that, we need to make a design matrix of the data, which includes the $x_0=1$ column, to represent the bias, remember (from the lecture notes) that we are now moving to a system where our prediction is given by an inner product:\n", "\n", "$$f(\\mathbf{x}_i) = \\mathbf{x}_i^\\top\\mathbf{w}$$\n", "\n", "where each vector $\\mathbf{x}_i$ is given by appending a 1 onto the original vector\n", "\n", "$$\\mathbf{x}_i = \n", "\\begin{bmatrix} \n", "1 \\\\\\\n", "x_i\n", "\\end{bmatrix}$$\n", "\n", "We can do this for the entire data set to form a design matrix $\\mathbf{X}$,\n", "\n", "$$\\mathbf{X} = \\begin{bmatrix} \n", "\\mathbf{x}_1^\\top \\\\\\ \n", "\\mathbf{x}_2^\\top \\\\\\ \n", "\\vdots \\\\\\\n", "\\mathbf{x}_N^\\top\n", "\\end{bmatrix} = \\begin{bmatrix}\n", "1 & x_1 \\\\\\\n", "1 & x_2 \\\\\\\n", "\\vdots & \\vdots \\\\\\\n", "1 & x_N \n", "\\end{bmatrix},$$\n", "\n", "which in numpy is done with the following commands:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "X = np.hstack((np.ones_like(x), x)) # [ones(size(x)) x]\n", "print(X)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[ 1.00000000e+00 1.89600000e+03]\n", " [ 1.00000000e+00 1.90000000e+03]\n", " [ 1.00000000e+00 1.90400000e+03]\n", " [ 1.00000000e+00 1.90800000e+03]\n", " [ 1.00000000e+00 1.91200000e+03]\n", " [ 1.00000000e+00 1.92000000e+03]\n", " [ 1.00000000e+00 1.92400000e+03]\n", " [ 1.00000000e+00 1.92800000e+03]\n", " [ 1.00000000e+00 1.93200000e+03]\n", " [ 1.00000000e+00 1.93600000e+03]\n", " [ 1.00000000e+00 1.94800000e+03]\n", " [ 1.00000000e+00 1.95200000e+03]\n", " [ 1.00000000e+00 1.95600000e+03]\n", " [ 1.00000000e+00 1.96000000e+03]\n", " [ 1.00000000e+00 1.96400000e+03]\n", " [ 1.00000000e+00 1.96800000e+03]\n", " [ 1.00000000e+00 1.97200000e+03]\n", " [ 1.00000000e+00 1.97600000e+03]\n", " [ 1.00000000e+00 1.98000000e+03]\n", " [ 1.00000000e+00 1.98400000e+03]\n", " [ 1.00000000e+00 1.98800000e+03]\n", " [ 1.00000000e+00 1.99200000e+03]\n", " [ 1.00000000e+00 1.99600000e+03]\n", " [ 1.00000000e+00 2.00000000e+03]\n", " [ 1.00000000e+00 2.00400000e+03]\n", " [ 1.00000000e+00 2.00800000e+03]\n", " [ 1.00000000e+00 2.01200000e+03]]\n" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "From the multivariate regression solution we derived in the lecture, the maximum likelihood solution for $\\mathbf{w}^*$ is given by\n", "\n", "$$\\mathbf{w}^* = \\left[\\mathbf{X}^\\top \\mathbf{X}\\right]^{-1} \\mathbf{X}^\\top \\mathbf{y}$$ \n", "\n", "First let's persuade ourselves of a few things. We suggested in the lecture that\n", "\n", "$$\\sum_{i=1}^n \\mathbf{x}_i\\mathbf{x}_i^\\top = \\mathbf{X}^\\top\\mathbf{X}$$\n", "\n", "We can show that this is, indeed the case for our data. First we need to know how to do matrix multiplication and transpose using numpy, this is done as" ] }, { "cell_type": "code", "collapsed": false, "input": [ "np.dot(X.T, X)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 16, "text": [ "array([[ 2.70000000e+01, 5.28200000e+04],\n", " [ 5.28200000e+04, 1.03365648e+08]])" ] } ], "prompt_number": 16 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we will compute the same thing with a for loop" ] }, { "cell_type": "code", "collapsed": false, "input": [ "store = np.zeros((2, 2))\n", "for i in range(X.shape[0]):\n", " store += np.outer(X[i, :], X[i, :])\n", "print store" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[ 2.70000000e+01 5.28200000e+04]\n", " [ 5.28200000e+04 1.03365648e+08]]\n" ] } ], "prompt_number": 17 }, { "cell_type": "markdown", "metadata": {}, "source": [ "I hope that you agree that the first version is a little more compact. \n", "\n", "### Solving the System\n", "\n", "The solution for $\\mathbf{w}$ is given in terms of a matrix inverse, but numerically this isn't the best way to compute it. What we actually want python to do is to *solve* the system of linear equations given by\n", "\n", "$$\\mathbf{X}^\\top\\mathbf{X} \\mathbf{w} = \\mathbf{X}^\\top\\mathbf{y}$$\n", "\n", "for $\\mathbf{w}$. This can be done in numpy using the command" ] }, { "cell_type": "code", "collapsed": false, "input": [ "np.linalg.solve?" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 18 }, { "cell_type": "markdown", "metadata": {}, "source": [ "so we can obtain the solution using" ] }, { "cell_type": "code", "collapsed": false, "input": [ "w = np.linalg.solve(np.dot(X.T, X), np.dot(X.T, y))\n", "print w\n", "print c\n", "print m" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[ 2.88952457e+01]\n", " [ -1.29806477e-02]]\n", "783.527379727\n", "-0.398725964251\n" ] } ], "prompt_number": 19 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Allowing us to plot the fit as follows" ] }, { "cell_type": "code", "collapsed": false, "input": [ "m = w[1]; c=w[0]\n", "f_test = m*x_test + c\n", "print(m)\n", "print(c)\n", "plt.plot(x_test, f_test, 'b-')\n", "plt.plot(x, y, 'rx')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[-0.01298065]\n", "[ 28.89524574]\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 20, "text": [ "[]" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHc9JREFUeJzt3XmUVPWZ//H3gxgVt4ajQUdw0IlORuMogyIjGiuOa6PG\nNWpicLeRZMyiTmJ0DpAMSU7MTNT5zU86QR0dHJeoUbRREbXRcESjIi64oY0/UMTkQLkhsj2/P763\npWh6qeVW3Vt1P69z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6M/uU8HrSHH/n338x8LhH96aY2QzgH4BppCT+Xv72qXzvWrgZ9C7gf9z9nmjzMjPbyd3fi8od\n70fbU/f+LTH+2N6/cbfwF5rZodHyYcDr0fKr0TpmtjVh1M1Xo7rUh2Z2oJkZ8G3CsAyJMLMdo9/9\ngCuB66Jd04HTzewLUetmD+Dpeok/utrfBvzI3Z/sPN7dl5Lu+KdEcX7V3Xdz992Aq4HJ7v5/6+Xv\nDzwE7GNmW5lZf+BQ4OU0xd/T354Uvnej5+vuZtDpwFnR8lkF8aTq/Vtq/LG+fyu40nwr8C7hq99i\nwpX9/Qm1qOeBJ4Hh0bFbEFozLwIvs3EvixHR9oXAteXGE0P85wIXE66Yvwb8vMvxP4lifJWoJ1K9\nxE94A38MzCv42aFe4u/yuAnAD+vp7x8d/y3gpSjWXyYZf4n/O2l87x4MrI/yTOf/89HAIMIF59eB\nmUBTwWNS8/4tNf4437+68UpEJCM0xaGISEYo4YuIZIQSvohIRijhi4hkhBK+iEhGKOGLiGSEEr6I\nSEYo4YuIZMT/B0w3BHPgeZdvAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 20 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Introducing a Basis: Quadratic Fit\n", "\n", "Now we will fit a quadratic model using basis functions. Given everything we've learnt above, this is now quite easy to do. Firstly, we need to create a design matrix that contains the quadratic basis, \n", "\n", "$$\\mathbf{\\Phi} = \\left[ \\mathbf{1} \\quad \\mathbf{x} \\quad \\mathbf{x}^2\\right]$$\n", "\n", "where this notation means that each column of $\\mathbf{\\Phi}$ is derived from the entire set of input years." ] }, { "cell_type": "code", "collapsed": false, "input": [ "Phi = np.hstack([np.ones(x.shape), x, x**2])" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 21 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can solve this system for $\\mathbf{w}$ just as we did for the linear case, so we have," ] }, { "cell_type": "code", "collapsed": false, "input": [ "w = np.linalg.solve(np.dot(Phi.T, Phi), np.dot(Phi.T, y))\n", "print(w)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[[ 6.43641954e+02]\n", " [ -6.42502988e-01]\n", " [ 1.61109704e-04]]\n" ] } ], "prompt_number": 22 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can plot the solution in two different ways, either we take" ] }, { "cell_type": "code", "collapsed": false, "input": [ "f_test = w[2]*x_test**2 + w[1]*x_test + w[0]\n", "plt.plot(x_test, f_test, 'b-')\n", "plt.plot(x, y, 'rx')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 23, "text": [ "[]" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYFPW1//H3YYvg1hoVE8FAFKNEDIiiAsr83AGFIHrF\nuKC5MShGE40TTfBG9HHUSPy55LqQqNG4xxBUFhUXxgUVRUFxQ02GuLJEaNyjwLl/fGu0GWbpnqnp\n6p76vJ6nn66uqu4609Cnq099F3N3RESk7WuXdAAiIlIcSvgiIimhhC8ikhJK+CIiKaGELyKSEkr4\nIiIp0SGfncxsMfAhsAb40t0H1NleAdwD/DNaNcXdL4gvTBERaam8Ej7gQIW7r2hkn0fdfUQMMYmI\nSCsopKRjLdwuIiIJyjfhO/CQmc0zsxMb2D7QzF4ws5lm1ju+EEVEJA75lnQGufv7ZrYl8KCZvebu\nj+dsfx7o7u6fmtlQ4G5gh7iDFRGR5rNCx9Ixs3OBj9390kb2qQH659b8zUyD9oiINIO7x1Iyb7Kk\nY2ZdzGzjaHlD4EBgYZ19upqZRcsDCF8k613gdfeyvZ177rmJx5DW+Ms5dsWf/K3c449TPiWdrsDU\nKJ93AG5191lmNi5K4pOBw4GTzWw18CkwJtYoRUSkxZpM+O5eA/StZ/3knOWrgKviDU1E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kr4IiIpoYQvIpIS/wcBL7feDAyMTgAAAABJ\nRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 23 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or we can do the matrix form of this equation which first involves creating a design matrix for the test points,\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "Phi_test = np.hstack((np.ones_like(x_test), x_test, x_test**2))" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 24 }, { "cell_type": "markdown", "metadata": {}, "source": [ "and then computing the value of the function using a matrix multiply" ] }, { "cell_type": "code", "collapsed": false, "input": [ "f_test = np.dot(Phi_test,w)\n", "plt.plot(x_test, f_test, 'b-')\n", "plt.plot(x, y, 'rx')\n", "w" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 25, "text": [ "array([[ 6.43641954e+02],\n", " [ -6.42502988e-01],\n", " [ 1.61109704e-04]])" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEACAYAAACwB81wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYFPW1//H3YYvg1hoVE8FAFKNEDIiiAsr83AGFIHrF\nuKC5MShGE40TTfBG9HHUSPy55LqQqNG4xxBUFhUXxgUVRUFxQ02GuLJEaNyjwLl/fGu0GWbpnqnp\n6p76vJ6nn66uqu4609Cnq099F3N3RESk7WuXdAAiIlIcSvgiIimhhC8ikhJK+CIiKaGELyKSEkr4\nIiIp0SGfncxsMfAhsAb40t0H1NleAdwD/DNaNcXdL4gvTBERaam8Ej7gQIW7r2hkn0fdfUQMMYmI\nSCsopKRjLdwuIiIJyjfhO/CQmc0zsxMb2D7QzF4ws5lm1ju+EEVEJA75lnQGufv7ZrYl8KCZvebu\nj+dsfx7o7u6fmtlQ4G5gh7iDFRGR5rNCx9Ixs3OBj9390kb2qQH659b8zUyD9oiINIO7x1Iyb7Kk\nY2ZdzGzja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J/needC5xRTu9/\ntP/RwEtRrBcnGX+B/3dK8bM7GFgb5Zna/88HA5sTLji/DswCMjnPKZnPb6Hxx/n5VccrEZGU0BSH\nIiIpoYQvIpISSvgiIimhhC8ikhJK+CIiKaGELyKSEkr4IiIpoYQvIpIS/wcBL7feDAyMTgAAAABJ\nRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 25 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note the values of the coefficient $w_2$ in particular. It is relatively small, because it is multiplying a large number (square of 2000 is 4 million). This need to use small coefficients becomes worse as we increase the order of the fit. As an exercise for later, try fitting higher order polynomials to the data. See what happens as you increase the polynomial order.\n", "\n", "## Generalization\n", "\n", "The aim of this notebook is to review the different methods of model selection: hold out validation, leave one out cross validation and cross validation. \n", "\n", "## Training Error\n", "\n", "The first thing we'll do is plot the training error for the polynomial fit. To do this let's set up some parameters." ] }, { "cell_type": "code", "collapsed": false, "input": [ "num_data = x.shape[0]\n", "num_pred_data = 100 # how many points to use for plotting predictions\n", "x_pred = np.linspace(1890, 2016, num_pred_data)[:, None] # input locations for predictions\n", "order = 4 # The polynomial order to use.\n", " " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 26 }, { "cell_type": "markdown", "metadata": {}, "source": [ "now let's build the basis matrices.\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# build the basis set\n", "Phi = np.zeros((num_data, order+1))\n", "Phi_pred = np.zeros((num_pred_data, order+1))\n", "for i in range(0, order+1):\n", " Phi[:, i:i+1] = x**i\n", " Phi_pred[:, i:i+1] = x_pred**i" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 27 }, { "cell_type": "markdown", "metadata": {}, "source": [ "now we can solve for the regression weights and make predictions both for the training data points, and the test data points. That involves solving the linear system given by\n", "\n", "$$\\boldsymbol{\\Phi}^\\top \\boldsymbol{\\Phi} \\mathbf{w}^* = \\boldsymbol{\\Phi}^\\top \\mathbf{y}$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# solve the linear system\n", "w_star = np.linalg.solve(np.dot(Phi.T, Phi), np.dot(Phi.T, y))" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 28 }, { "cell_type": "markdown", "metadata": {}, "source": [ "and using the resulting vector to make predictions at the training points and test points,\n", "\n", "$$\\mathbf{f} = \\boldsymbol{\\Phi}\\mathbf{w}.$$\n", "\n", "To implement this in practice we need to use basis matrices for both the predictions and the training points." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# predict at training and test points\n", "f = np.dot(Phi, w_star)\n", "f_pred = np.dot(Phi_pred, w_star)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 29 }, { "cell_type": "markdown", "metadata": {}, "source": [ "These can be used to compute the error\n", "\n", "$$E(\\mathbf{w}) = \\frac{n}{2} \\log \\sigma^2 + \\frac{1}{2\\sigma^2} \\sum_{i=1}^n \\left(y_i - \\mathbf{w}^\\top \\phi(\\mathbf{x}_i)\\right)^2 \\\\\\\n", "E(\\mathbf{w}) = \\frac{n}{2} \\log \\sigma^2 + \\frac{1}{2\\sigma^2} \\sum_{i=1}^n \\left(y_i - f_i\\right)^2$$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# compute the sum of squares term\n", "sum_squares = ((y-f)**2).sum()\n", "# fit the noise variance\n", "sigma2 = sum_squares/num_data\n", "error = 0.5*(num_data*np.log(sigma2) + sum_squares/sigma2)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 30 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we have the fit and the error, let's plot the fit and the error." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# print the error and plot the predictions\n", "print(\"The error is: %2.4f\"%error)\n", "plt.plot(x_pred, f_pred)\n", "plt.plot(x, y, 'rx')\n", "ax = plt.gca()\n", "ax.set_title('Predictions for Order 5')\n", "ax.set_xlabel('year')\n", "ax.set_ylabel('pace (min/km)')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The error is: -29.9371\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 31, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEZCAYAAABmTgnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYFNXZ9/HvrSAgouMWZFNI1ChuIAooohN9giJojLgk\nxpVEUWI0RlHjuGDMqHlM3F6NmqhR4xaXaBDcEB1UghJZFHB/HBRQEMM0ogiy3O8fpwaaYWa6Z6a7\nqnvm97muuqaqurrq7obuu885dc4xd0dERKQ+GyUdgIiIFD4lCxERyUjJQkREMlKyEBGRjJQsREQk\nIyULERHJSMlCCo6Z3WNmV0XrA83s3Uae5zYzuzS30WW85o/NbK6ZLTWzveK8dn3M7FQzeyXpOKR4\nKVlIo5jZHDNbFn0pLjCzv5lZ+xyd3qMFd3/F3XfJIp4Nvgzd/Sx3/32OYsrWH4GR7t7B3d/MxQnN\nbKiZTTGzr8zsCzO738y65OLcTYjpHjNbEf37LzWzL83MkoxJ8kvJQhrLgaHu3gHYG9gH2OBXvJm1\nauT5i+6LJ/qy3B54u5HP3+DzaGbHAA8A1wNbA7sBK4BXzaykjvNs3JjrNyQuwr//H6Kk2MHdN3f1\n8G3WlCykydz9U+BZwhcZZrbGzEaa2QfAe9G+oWY2w8yqzGySme1R/Xwz621m06Jfpw8DbdMeKzWz\nuWnb3czsn2b2efQr+/+Z2S7A7cB+0a/cxdGxa6uzou3TzewDM/uvmf3LzDqlPbbGzEaY2ftRjLek\nPbajmU00s5SZLYpiXI+ZtQGWAhsDb0avHTPb1cwqonPOMrMj0p5zT1RV9rSZfQWU1jinAX8CrnL3\nh919hbsvBH4BfAWcFx13avSeXm9mXwBXmNlWZjbGzJaY2evA92qcexczGx+9F++a2bHZxpV+mjr2\nS3Pk7lq0NHgBKoFDovVuwCzgymh7DfAcUAK0AXoDC4F9CV8wJ0fPbw1sAnwMnEv4oh0GfA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rjT0QTy8wys9PT9n9lZn80sxmEoS5EipaShciG7gZOhrUlguOB\nBcCO7t6XMCx0HzMbGB0/3N33AfYFzjGzLaP9mwKvuXsvd/93rK9AJMcKadRZkYLg7h+b2X/NrBdh\nZrLphEQwyMymR4e1B3YEXgHOjSZYgjBC6U6EWchWE0YHFSl6ShYitbuTMMBlR0JJ4xDgGnf/S/pB\nZlYaPdbf3Zeb2UtA2+jh5a7B16SZUDWUSO2eIIzmuQ/wLGGo8OHRUNuYWZdoaO7NgaooUeyC2iak\nmVLJQqQW7r7SzF4kJAIHxpvZrsDkMPw/S4ETCYnkTDN7mzBE9+T008QctkjeaIhykVpEDdtTgWPc\n/f+SjkckaaqGEqnBzHoCHwAvKFGIBCpZiIhIRipZiIhIRkoWIiKSkZKFiIhkpGQhIiIZKVmIiEhG\nShYiIpLR/wc2nF4QOWe5fQAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 31 }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Solution with QR Decomposition\n", "\n", "Performing a solve instead of a matrix inverse is the more numerically stable approach, but we can do even better. A [QR-decomposition](http://en.wikipedia.org/wiki/QR_decomposition) of a matrix factorises it into a matrix which is an orthogonal matrix $\\mathbf{Q}$, so that $\\mathbf{Q}^\\top \\mathbf{Q} = \\mathbf{I}$. And a matrix which is upper triangular, $\\mathbf{R}$. \n", "$$\n", "\\boldsymbol{\\Phi}^\\top \\boldsymbol{\\Phi} \\mathbf{w} = \\boldsymbol{\\Phi}^\\top \\mathbf{y}\n", "$$\n", "$$\n", "(\\mathbf{Q}\\mathbf{R})^\\top (\\mathbf{Q}\\mathbf{R})\\mathbf{w} = (\\mathbf{Q}\\mathbf{R})^\\top \\mathbf{y}\n", "$$\n", "$$\n", "\\mathbf{R}^\\top (\\mathbf{Q}^\\top \\mathbf{Q}) \\mathbf{R} \\mathbf{w} = \\mathbf{R}^\\top \\mathbf{Q}^\\top \\mathbf{y}\n", "$$\n", "$$\n", "\\mathbf{R}^\\top \\mathbf{R} \\mathbf{w} = \\mathbf{R}^\\top \\mathbf{Q}^\\top \\mathbf{y}\n", "$$\n", "$$\n", "\\mathbf{R} \\mathbf{w} = \\mathbf{Q}^\\top \\mathbf{y}\n", "$$\n", "This is a more numerically stable solution because it removes the need to compute $\\boldsymbol{\\Phi}^\\top\\boldsymbol{\\Phi}$ as an intermediate. Computing $\\boldsymbol{\\Phi}^\\top\\boldsymbol{\\Phi}$ is a bad idea because it involves squaring all the elements of $\\boldsymbol{\\Phi}$ and thereby potentially reducing the numerical precision with which we can represent the solution. Operating on $\\boldsymbol{\\Phi}$ directly preserves the numerical precision of the model.\n", "\n", "This can be more particularly seen when we begin to work with *basis functions* in the next session. Some systems that can be resolved with the QR decomposition can not be resolved by using solve directly." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import scipy as sp\n", "Q, R = np.linalg.qr(X)\n", "w = sp.linalg.solve_triangular(R, np.dot(Q.T, y)) \n", "w" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 32, "text": [ "array([[ 2.88952457e+01],\n", " [ -1.29806477e-02]])" ] } ], "prompt_number": 32 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Putting it Together\n", "\n", "Now we look at how we can fit different polynomial basis sets to the olympic data and compute the training error." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# import the time module to allow python to pause.\n", "import time\n", "# import the IPython display module to clear the output.\n", "from IPython.display import clear_output, display\n", "\n", "def polynomial(x, degree):\n", " degrees = np.arange(degree+1)\n", " return x**degrees\n", "\n", "num_data = len(x)\n", "error_list = []\n", "max_degree = 6\n", "sigma2 = 1\n", "fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,6))\n", "for degree in range(0, max_degree+1):\n", "\n", " # 1. build the basis set\n", " Phi = polynomial(x, degree)\n", " Phi_pred = polynomial(x_pred, degree)\n", " \n", " # 2. solve the linear system with QR decomposition\n", " Q, R = np.linalg.qr(Phi)\n", " w = sp.linalg.solve_triangular(R, np.dot(Q.T, y)) \n", "\n", " # 3. make predictions at training and test points\n", " f_pred = np.dot(Phi_pred, w)\n", " f = np.dot(Phi, w)\n", "\n", " # 4. compute the error and append it to a list.\n", " error_list.append(((y-f)**2).sum() + num_data/2.*np.log(sigma2))\n", "\n", " # 5. plot the predictions\n", " axes[0].clear()\n", " axes[1].clear() \n", " axes[0].plot(x_pred, f_pred, linewidth=2)\n", " axes[0].plot(x, y, 'rx', markersize=10, linewidth=2)\n", " axes[0].set_ylim((2.5, 5.5))\n", " axes[0].set_title('Predictions for Degree ' + str(degree) + ' model.')\n", " axes[1].plot(np.arange(0, degree+1), np.asarray(error_list), linewidth=2)\n", " axes[1].set_xlim((0, max_degree))\n", " axes[1].set_ylim((0, 10))\n", " axes[1].set_title('Training Error')\n", " display(fig)\n", " time.sleep(1)\n", " clear_output()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAsEAAAF6CAYAAAD4VIVfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XmcU/X1//HXYZFVGBEFFAQU97pRBRSVqVutaK2t/aq1\nWq1aFLtYLXbBiv7saFu02rqi1bbWVtS6i1rXsYq7IK64sYiAojBhEVBgzu+PTwJhyDYzSW6W9/Px\nyCM3uTf3nhuGm5NPzufzMXdHRERERKSatIk6ABERERGRYlMSLCIiIiJVR0mwiIiIiFQdJcEiIiIi\nUnWUBIuIiIhI1VESLCIiIiJVR0lwmTGzv5vZRfHl/cxsegv3c62ZnZff6LIe8ygzm2NmS81st2Ie\nW9Izs5PM7Okct1379yci1cHMHjSzE/K9rUjUlAQXgJnNMrPl8WTvYzP7m5l1ydPuPX7D3Z929x1y\niGeDJMfdz3D33+UpplxdCox2943dfVprd2Zm9Wa2wsyWmNliM3vZzH5pZhvlIdaCM7O2ZvY7M5sb\nP4cpZtY96riyWPv3JyKly8yWxT+DlppZ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/e4E+w4juM4juM0HO4EO47jOI7jOA2HO8GO\n4ziO4zhOw+FOsOM4juM4jtNwuBPsOI7jOI7jNBzuBDuO4ziO4zgNhzvBjuM4juM4TsPxPwfI3PQG\nZ3jfAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 33 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 33 } ], "metadata": {} } ] }