{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "---\n",
    "execute:\n",
    "  enabled: false\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-1 fw=all -->\n",
    "\n",
    "# Naive Bayes\n",
    "\n",
    "The maximum-likelihood principle of that section tells us how to *fit* a probabilistic model, and the statistics of that section tell us how to *judge* one; here both go to work on a classifier. The **naive Bayes** classifier is among the simplest models that deserve the name \"learning\": it estimates a probability model by counting, predicts with Bayes' rule, and survives the curse of dimensionality through one visibly wrong assumption. We build it end to end, run it on handwritten digits, and then examine the result with the tools this chapter built: a bootstrap error bar on its accuracy, a look at which digits it actually confuses, and a measurement of how far its confidence can be trusted."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "naive-bayes-imports"
   },
   "source": [
    "%matplotlib inline\n",
    "from d2l import jax as d2l\n",
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "d2l.use_svg_display()"
   ],
   "execution_count": 1,
   "outputs": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-2 fw=all -->\n",
    "\n",
    "## Bayes' Rule for Classification\n",
    "\n",
    "A classifier maps an example $\\mathbf{x}\\in\\mathbb{R}^d$ to a label $y\\in\\{1,\\ldots,K\\}$. The natural target is the *posterior* $p(y\\mid\\mathbf{x})$, how plausible each label is given what we observed, and the natural prediction is its most likely value,\n",
    "\n",
    "$$\\hat{y} = \\mathop{\\mathrm{argmax}}_y \\, p(y\\mid\\mathbf{x}).$$\n",
    "\n",
    "Estimating $p(y\\mid\\mathbf{x})$ directly is hopeless. With $d$ binary features there are $2^d$ distinct inputs $\\mathbf{x}$; storing a label distribution for each would need on the order of $2^d$ numbers, and we would have to *see* most of those inputs to estimate them. With the $784$ pixels of an MNIST image that is $2^{784}$ patterns, vastly more than there are atoms in the universe. Memorizing one answer per input amounts to a lookup table we could never fill.\n",
    "\n",
    "Bayes' rule, the equation, turns the problem around. Instead of modelling \"which label, given this image,\" we model \"which images, given this label\", the *generative* direction:\n",
    "\n",
    "$$\\hat{y} = \\mathop{\\mathrm{argmax}}_y \\, p(y\\mid\\mathbf{x}) = \\mathop{\\mathrm{argmax}}_y \\, \\frac{p(\\mathbf{x}\\mid y)\\,p(y)}{p(\\mathbf{x})} = \\mathop{\\mathrm{argmax}}_y \\, p(\\mathbf{x}\\mid y)\\,p(y).$$\n",
    "\n",
    "The denominator $p(\\mathbf{x})$ is the same for every $y$, so it cannot change which label wins the $\\mathrm{argmax}$ and we drop it; in shorthand, $p(y\\mid\\mathbf{x}) \\propto p(\\mathbf{x}\\mid y)\\,p(y)$. (Should we ever want the actual posterior probabilities, normalizing the numerators so they sum to one recovers $p(\\mathbf{x})$ for free.)\n",
    "\n",
    "This is the defining choice of a **generative** classifier: rather than modelling the label given the data, it models how the *data are generated* within each class, $p(\\mathbf{x}\\mid y)$, together with how often each class occurs, $p(y)$, and lets Bayes' rule turn that into a decision. It is the opposite of the **discriminative** route taken by logistic regression and the softmax classifier of that section, which fit the posterior $p(y\\mid\\mathbf{x})$ directly, without requiring a model for the marginal input distribution. The two form the classic generative--discriminative pair. In particular\n",
    "well-specified comparisons, including the models analyzed by\n",
    "@Ng.Jordan.2002, a generative model can approach its asymptotic error\n",
    "with fewer examples while a discriminative model reaches a lower asymptotic\n",
    "error. This is a model-dependent trade-off, not a universal law: either side can\n",
    "win when its assumptions better match the data. Naive Bayes is the simplest generative classifier in wide use. the figure sketches the two routes side by side.\n",
    "\n",
    "![Two routes to a classifier. Left: a generative model learns how each class generates inputs (the class-conditional densities $p(\\mathbf{x}\\mid y)$ weighted by the priors $p(y)$) and flips them through Bayes' rule, predicting whichever class makes the observation most plausible; the tie point of the weighted densities is where the decision flips. Right: a discriminative model need not specify how inputs are generated; it devotes its capacity directly to the posterior $p(y\\mid\\mathbf{x})$, that is, to the decision boundary between the classes.](../img/mdl-prob-naive-genvdisc.svg)\n",
    "\n",
    "The reframing has not yet helped computationally: the *class-conditional* $p(\\mathbf{x}\\mid y)$ is still a distribution over the same $2^d$ patterns. The chain rule of probability (that section) lays the difficulty bare,\n",
    "\n",
    "$$p(\\mathbf{x}\\mid y) = p(x_1\\mid y)\\,p(x_2\\mid x_1, y)\\cdots p(x_d\\mid x_1,\\ldots,x_{d-1}, y),$$\n",
    "\n",
    "a product whose later factors condition on ever-longer histories and still hide $2^d$ parameters.\n",
    "\n",
    "### The Naive Assumption\n",
    "\n",
    "Here is the leap. *Assume the features are jointly conditionally independent\n",
    "given the label.* Pairwise conditional independence alone is not enough when\n",
    "$d>2$; the naive Bayes assumption is the full factorization of the conditional\n",
    "joint distribution into one-feature marginals:\n",
    "\n",
    "$$p(\\mathbf{x}\\mid y) = \\prod_{i=1}^d p(x_i\\mid y).$$\n",
    "\n",
    "As a graphical model the assumption is a star: the label $y$ points to every\n",
    "feature, and the features are joined by nothing\n",
    "(the figure, left). All a feature can learn about the\n",
    "others, it learns through the class label; given $y$, the features no longer\n",
    "talk to one another. A faithful model of a digit would add edges *among* the\n",
    "features (neighboring pixels co-fire), and naive Bayes simply erases them\n",
    "(the figure, right).\n",
    "\n",
    "![The naive assumption as a graphical model. Left: the label $y$ fans out to the features $x_1,\\ldots,x_d$ with no edges *among* the features, so they are independent once $y$ is known: the picture of conditional independence. Right: a faithful model would carry dependence edges between features (here $x_1$–$x_2$ and $x_3$–$x_d$); naive Bayes throws them away (struck out), which is exactly what makes it cheap and what makes it wrong.](../img/mdl-prob-naive-independence.svg)\n",
    "\n",
    "This is the assumption that makes Bayes \"naive,\" and it is *false*: in a real digit the pixels are strongly correlated, since an inked pixel makes its neighbors far more likely to be inked too. The model pretends each pixel is painted by an independent coin flip whose bias depends only on the digit. Yet the assumption is cheap. We no longer estimate one giant joint distribution; we estimate $d$ tiny one-feature distributions $p(x_i\\mid y)$ per class, only $\\mathcal{O}(dK)$ numbers instead of $\\mathcal{O}(2^d K)$. The curse of dimensionality, the same exponential blow-up that defeats grid-based integration in that section, is broken by fiat.\n",
    "\n",
    "Why tolerate a false assumption? Because the classifier only needs the largest probability to land on the correct label; the probabilities themselves can be far off. A model can be badly miscalibrated (massively over- or under-confident, as multiplying $784$ falsely-independent factors will be) and still pick the right winner. Naive Bayes routinely classifies well even where its independence story is plainly wrong [@Domingos.Pazzani.1997], and the savings let it learn from a modest dataset rather than an impossible one.\n",
    "\n",
    "Substituting the factorized class-conditional the equation into the Bayes-rule predictor $\\hat{y} = \\mathop{\\mathrm{argmax}}_y p(\\mathbf{x}\\mid y)\\,p(y)$ (the label-independent denominator already discarded) gives the **naive Bayes classifier** [@Maron.1961]:\n",
    "\n",
    "$$\\hat{y} = \\mathop{\\mathrm{argmax}}_y \\; p(y) \\prod_{i=1}^d p(x_i\\mid y).$$\n",
    "\n",
    "### Doing It in Log Space\n",
    "\n",
    "Equation the equation multiplies $d$ probabilities, each in $[0,1]$. For $d=784$ the product is vanishingly small: on the MNIST model below, single precision underflows $99.1\\%$ of all class scores to an exact zero (the prediction cell measures this directly), leaving the $\\mathrm{argmax}$ to break ties among zeros; even in double precision the surviving products run from about $10^{-26}$ down to $10^{-323}$, the very bottom of the representable range charted in that section. This is the practical face of the numerical issue we met in that section, and the fix is the same: the $\\mathrm{argmax}$ is unchanged by the increasing map $\\log$, and $\\log$ turns the product into a sum. Applied to the equation this gives the log-space form\n",
    "\n",
    "$$\\hat{y} = \\mathop{\\mathrm{argmax}}_y \\; \\log p(y) + \\sum_{i=1}^d \\log p(x_i\\mid y).$$\n",
    "\n",
    "A score is now a sum of $785$ well-behaved logarithms instead of a product that rounds to zero; the classifier becomes one table of pre-computed log-probabilities and a few additions.\n",
    "\n",
    "The score also has a telling shape. For a binary feature, $\\log p(x_i\\mid y) = x_i \\log p(x_i{=}1\\mid y) + (1-x_i)\\log p(x_i{=}0\\mid y)$, so the log-space objective the equation becomes\n",
    "\n",
    "$$\\log p(y) + \\sum_{i=1}^d \\Bigl[ x_i \\log p(x_i{=}1\\mid y) + (1-x_i)\\log p(x_i{=}0\\mid y) \\Bigr],$$\n",
    "\n",
    "which is **affine in $\\mathbf{x}$**, a constant plus a weighted sum of the pixels [@Bishop.2006]. Each class score is therefore $\\mathbf{w}_y\\cdot\\mathbf{x} + b_y$, and the boundary between any two classes, where their scores tie, is a hyperplane. So naive Bayes is a *linear* classifier: it carves the input space with the same decision planes as the softmax classifier of that section (and the mean-difference rule of that section); the two models differ only in how they *set* those planes: by counting class-conditional frequencies here, by gradient descent on the posterior there.\n",
    "\n",
    "## Training Is Counting\n",
    "\n",
    "Naive Bayes needs two ingredients: the class prior $p(y)$ and, for each class, the per-feature likelihoods $p(x_i\\mid y)$. Both are estimated by **maximum likelihood**, and for the categorical and Bernoulli models here the MLE is just an empirical frequency: *training is counting*.\n",
    "\n",
    "For the prior, the maximum-likelihood estimate of $p(y)$ is the fraction of training examples carrying label $y$: if class $y$ appears $n_y$ times in $n = \\sum_y n_y$ examples, then $\\hat p(y) = n_y / n$. For binary features, $p(x_i = 1\\mid y)$ is the probability that feature $i$ fires for class $y$, a Bernoulli parameter whose MLE is again a frequency: of the $n_y$ examples in class $y$, the fraction in which feature $i$ is on. Storing the values $\\hat p(x_i = 1 \\mid y)$ in an array $P_{xy}$ (in the code below, one $28\\times 28$ grid per class) fixes both Bernoulli outcomes, since $\\hat p(x_i = 0\\mid y) = 1 - \\hat p(x_i = 1\\mid y)$.\n",
    "\n",
    "One hazard remains. If feature $i$ is *never* on for class $y$ in the training set, the MLE is $\\hat p(x_i=1\\mid y)=0$, and a single such feature at test time annihilates the whole product in the equation (and sends the equation to $-\\infty$). The cure is **Laplace smoothing** [@Laplace.1814]: add a pseudocount, estimating $p(x_i=1\\mid y)$ as $(n_{iy}+1)/(n_y+2)$ rather than $n_{iy}/n_y$, where $n_{iy}$ counts the class-$y$ examples with feature $i$ on and the $+2$ covers the two outcomes a binary pixel can take; a categorical feature with $v$ possible values gets $+1$ on each value's count and $+v$ in the denominator, so the smoothed probabilities still sum to one (the text models at the end of this section smooth the same way, with $+|V|$ for a vocabulary $V$). The pseudocount has a Bayesian justification: $(n_{iy}+1)/(n_y+2)$ is the posterior *mean* of the Bernoulli parameter under a uniform $\\mathrm{Beta}(1,1)$ prior, Laplace's *rule of succession*, as that section derives (along with the numerically coincident, but conceptually distinct, $\\mathrm{Beta}(2,2)$ MAP estimate it is often conflated with).\n",
    "\n",
    "Nothing in the recipe is married to binary features, either. For continuous inputs the standard move is **Gaussian naive Bayes**: model each feature, within each class, by a univariate Gaussian (that section), so that training is again a single counting-style pass (a per-class, per-feature mean and variance) and the log-space score the equation simply sums Gaussian log-densities instead of Bernoulli ones. That is the principled alternative to *thresholding* continuous features into bits, which is what we do to the pixel intensities below; thresholding gives an even simpler model but discards the gray levels.\n",
    "\n",
    "## A Worked Example: MNIST Digits\n",
    "\n",
    "We classify handwritten digits from MNIST [@LeCun.Bottou.Bengio.ea.1998]: $28\\times 28$ grayscale images of the digits $0$ through $9$. To make each pixel a binary feature we threshold it at half-intensity, so $x_i\\in\\{0,1\\}$ records whether pixel $i$ is inked. We load the two splits and binarize, ending with plain NumPy arrays: `X` of shape `(n, 28, 28)` and integer labels `Y`. Only this loading step touches the deep learning library; everything from here on is plain NumPy counting."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "naive-bayes-load"
   },
   "source": [
    "(X, Y), (X_test, Y_test) = tf.keras.datasets.mnist.load_data()\n",
    "X = np.floor(X / 128).astype('float32')\n",
    "X_test = np.floor(X_test / 128).astype('float32')\n",
    "X.shape, Y.shape"
   ],
   "execution_count": 2,
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "((60000, 28, 28), (60000,))"
     },
     "metadata": {},
     "execution_count": 2
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-3 fw=all -->\n",
    "\n",
    "### Estimating the Model\n",
    "\n",
    "Training is two counts, done in NumPy. The prior $\\hat p(y)$ is the class frequency; the likelihood array $P_{xy}$ holds, for each class, the Laplace-smoothed fraction of its images in which each pixel is inked. Prediction will then work in log space. The per-class `for y in range(10)` loop below is written for clarity, one class at a time; an idiomatic vectorized form would replace it with `np.bincount(Y)` for the class counts and a one-hot matrix multiply `onehot(Y).T @ X` for the per-class pixel sums."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "naive-bayes-train"
   },
   "source": [
    "n_y = np.array([(Y == y).sum() for y in range(10)])\n",
    "P_y = n_y / n_y.sum()                                  # class prior, p(y)\n",
    "\n",
    "n_x = np.stack([X[Y == y].sum(axis=0) for y in range(10)])\n",
    "P_xy = (n_x + 1) / (n_y + 2).reshape(10, 1, 1)         # Laplace-smoothed p(x_i=1|y)\n",
    "P_y"
   ],
   "execution_count": 3,
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "array([0.09871667, 0.11236667, 0.0993    , 0.10218333, 0.09736667,\n       0.09035   , 0.09863333, 0.10441667, 0.09751667, 0.09915   ])"
     },
     "metadata": {},
     "execution_count": 3
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-4 fw=all -->\n",
    "\n",
    "Each class's slice of $P_{xy}$ is a $28\\times 28$ image of per-pixel \"on\" probabilities for one digit: a picture of what the model believes a class looks like. Plotting all ten shows ghostly averaged digits: this is the entire learned model."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "naive-bayes-templates"
   },
   "source": [
    "d2l.show_images([P_xy[y] for y in range(10)], 2, 5,\n",
    "                titles=[str(y) for y in range(10)]);"
   ],
   "execution_count": 4,
   "outputs": [
    {
     "output_type": "display_data",
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"432.9pt\" height=\"192.393297pt\" viewBox=\"0 0 432.9 192.393297\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2026-07-19T13:55:17.601242</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.10.8, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 192.393297 \nL 432.9 192.393297 \nL 432.9 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 7.2 94.473297 \nL 79.355172 94.473297 \nL 79.355172 22.318125 \nL 7.2 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#pce1c0e498e)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAIf0lEQVR4nO1dWW9bVRC+m7d77fjaThonTdo0bVOVpawVi0ACCQnU5/4K/gH/hzdeEE9VJR4KEkItZe0CpEmTNE2I4y12HO/38nbnfCcQJSaBoZrvaUZj38XjMzPnO3PuNT8wr4eGgBWs//oCBPshTmEIcQpDiFMYQpzCEOIUhhCnMIQ4hSHEKQwhTmEI58SObNmRaMbwNJbrki2bAVuQ9UAfevFIDi0TbOaQGCK71cVzNPZ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37TJjb6q60LYAuXqLzPrmgNGNt4n8Oe0CzPDMQpDCFOYYjjyyk6la+UyIHWDG5t0/4/z9b2NIZIuVcDyjG3+gtga1+kcjoo3APb1eQq6Eklj1QDvO1v27ii+enaG5H89P4k2MYpjRnpZe1ZMRWk+fVpwmEhI4UhxCkMcXLv5FL7aLXGvaBJq5KWFvbS2mqd06KSuVHBLdF3S/RGnJ/OnQbbuXHsSc4nKIRu7mGIfLyhNV0sEgNR/BVD0Ngilb3m+hbY9DAtD4t+hiBOYQhxCkOYH5jX//0XGSp7yk0HWWJTa742lXdCGvks2PpF2gPTKWC+6Wbw/xYoh3U6eMvJGuaNeJXyWmxrB2xhlcreoKW9RK0/Gq2iQ0YKQ4hTGEKcwhAnN085CDCHwTi8Ly6rtb/2eCZ7iXKTZ+L/y7P2bekhaHvs9zWrK/Z9r9o8wpO4R4WMFIYQpzDEfxO+jgKVqgi1ZrejbPr4H0FGCkOIUxhCnMIQ4hSGEKcwhDiFIcQpDCFOYQhxCkOIUxjiT6RDl/9BBRhWAAAAAElFTkSuQmCC\" id=\"imagef6ad9e6642\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"7.2\" y=\"-21.753297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 7.2 94.473297 \nL 7.2 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 79.355172 94.473297 \nL 79.355172 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 7.2 94.473297 \nL 79.355172 94.473297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 7.2 22.318125 \nL 79.355172 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_1\">\n    <!-- 0 -->\n    <g transform=\"translate(39.460086 16.318125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-30\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path d=\"M 93.786207 94.473297 \nL 165.941379 94.473297 \nL 165.941379 22.318125 \nL 93.786207 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p23e96ee7a4)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAFfUlEQVR4nO2du3McRRDGZ3dv7y0h6YTLbwUULhsCIgeOISMhIOA/4f8hosgoioSYiCIDl6sgwMZWSUbo4Xvo3jMErtrpr690IKO7/Sj6F02rT7t79e10z87O9CUfJZ8GZ1CRln0BxiImCiEmCiEmCiEmCiEmCiGVsi/gykgStMN/d6RvPYUQE4UQE4WQ1eUUEeOTSo6uarSTRh19OX7WVcQl6jyRiXtK5ZQwHKHd6xdtPxrjcfzcMWE9hRAThZCrC19phqYMURsb+NlrO0VzdKMNrlEHw9esEcNSWHILJSoCNY7xD82n3aKdvT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cx/2Sn+FV+a+O++uk4+vMa5q3xJtaDaezEsrxZD8vjpmK1jR+vZqG49RRCTBRC6MKXBiq1pngPpWIGpKoq443qOMyFY3oMg/M6hp3pVixTlZ1ihfFEzBonau+k3Mv5+g9vFs6spxBiohBiohBCn1NgdYuK0dkk2hUcubr89OL7rYL7kqAkonPO+VxUW22pH93pxnyzUPl7rs75hqVaracQYqIQUn74+rtho9yvot4C5r1o14/x/somKiZJ3wjPWe2jnY4vLi0lZ61Dupp72noKISYKISYKIeXnFMXCnkcxrZGenIFPDlbzLu6T91Wc+U3EG81Evd2UP4jgnHPJMC7GS/o4fvaDaMtFe6//sPyHDf4p1lMIMVEIMVEIocspC78uIXLKXC+2Pjm98DCXudsWMoGVKzQ0JgohfOHrMpBVtLsqrKcQYqIQYqIQYqIQYqIQYqIQYqIQYqIQYqIQYqIQ8hfVtqWCczmJGQAAAABJRU5ErkJggg==\" id=\"image8bbb2ff915\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"93.786207\" y=\"-21.753297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_8\">\n    <path d=\"M 93.786207 94.473297 \nL 93.786207 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_9\">\n    <path d=\"M 165.941379 94.473297 \nL 165.941379 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_10\">\n    <path d=\"M 93.786207 94.473297 \nL 165.941379 94.473297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_11\">\n    <path d=\"M 93.786207 22.318125 \nL 165.941379 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_2\">\n    <!-- 1 -->\n    <g transform=\"translate(126.046293 16.318125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-31\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_3\">\n   <g id=\"patch_12\">\n    <path d=\"M 180.372414 94.473297 \nL 252.527586 94.473297 \nL 252.527586 22.318125 \nL 180.372414 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p2cd82a673f)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAIdElEQVR4nO1dS2/kxhFmN8khh8PRjLSSdiVbgr17cGAjixjwLafA/gm++Z/6lEsOQYzYgBMbzsbwOvuS9dh5iTMjPn1j9VfCyJqxFq4Y9Z2qURx2c4pdVV1d1TSfmE8bTyEK9rcegOI6VCgCoUIRCBWKQKhQBEKFIhAqFIFQoQiECkUgVCgCEbyxOxvj0Ch74/vUsMa7LYy5/bVNs0b0qGbXNvXq+/Jr4T7V7fu8ATpTBEKFIhAbqy8T4E9t2kP+YKul6+0+8IrtuKXL2AeexzSUzUmVBAtUD3ZZOHSJtymwDahXqyfP8zxTOXx+7VXeko1De57nNYsFdpMXTuP2qk1nikCoUARChSIQa9kUE3Za2g4HwKuP96E9e0R2ZPwIZT8/Jn0fbi+xD2ZT8oz6DM66wIvPk5aORuiqBkvu5rqdMBZzy21JFwcLvE80IjsRjtCG2Isp3ng0bsl6PmedrnatdaYIhApFIFQoArGeTYkjauzvAG/2MIX2xQck7/DxGHifvft1S/+l/w3wQoP+/LPiXkv/dfwH4H119lZLn59uAc9O8dGMs2xp2NLIM6jf3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jTD2quA50pAqFCEYg39+nzm75H5bb5Qfw8cdyp+bCMFzm8a8nVvDbEUWe8vLzku6gb1pXcFXSmCIQKRSBUKALx5mzKbcH1NzvN+oZT/fC6OxqOBOhMEQgVikCoUARChSIQKhSBUKEIxM97OpcMbkNcTAAAAABJRU5ErkJggg==\" id=\"imagebbac627634\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"180.372414\" y=\"-21.753297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_13\">\n    <path d=\"M 180.372414 94.473297 \nL 180.372414 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_14\">\n    <path d=\"M 252.527586 94.473297 \nL 252.527586 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_15\">\n    <path d=\"M 180.372414 94.473297 \nL 252.527586 94.473297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_16\">\n    <path d=\"M 180.372414 22.318125 \nL 252.527586 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_3\">\n    <!-- 2 -->\n    <g transform=\"translate(212.6325 16.318125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-32\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_4\">\n   <g id=\"patch_17\">\n    <path d=\"M 266.958621 94.473297 \nL 339.113793 94.473297 \nL 339.113793 22.318125 \nL 266.958621 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#pf5288babcd)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAIQElEQVR4nO1dzW8TVxDfb3/GTuJ8QZqmhK+AWg6lH6qCONFrT/yBVW+99dILlYpEb60KahFqBS0BQiAhcWI7Tuy1vbs9VNp5v7HiYCvAKMzv9IZZr9/y85uZnTdvYt+wbyaWQhScdz0BRT+UFIFQUgRCSREIJUUglBSB8N7YnR03HdqODSrbM77WdVHHZMv8rM1+Q0lMwyhGXbeLl0bmtdGh9/lffrdvCbpSBEJJEQglRSCG8yk22Xfb81GVzYDsFAvpOJkoga47TbrWdAC6VgV/J90ifWfCfkJuSONMDf1AfhN9SnbzgD5XbYAuqaMct9qk6+F93oa/0ZUiEEqKQAxlvsxw1TRPlmVZ9kQZ5PDDyXRcO4umrX6RxplzaDq+mn8C8uel1XRccZugq0bFdHxn9wLofn26CLLzcDwdjz9Ec1pabYHsr++k43h7B3SmabNiFlofE3SlCISSIhBKikAM9ik2S49kyDfY5THQdefQpzQ+omvr5/G2uQu1dHx9/jHorhTXQL4QbKTjSfcAdJ/YL9PxSu5f0D2ZmQD5h6Wr6fjnJfQ/+3+if6w8oDA9/w+G7O7GVjqOmvugOy4foytFIJQUgVBSBOIIn4Kc2QHZ1ySfBV1nAm2vmR6xLExNNGv5dHyrfRF0P9koxxHNwfXQZldKZNMvT2yC7krxOcgr5U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\"image83afa9ce6b\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"266.958621\" y=\"-21.753297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_18\">\n    <path d=\"M 266.958621 94.473297 \nL 266.958621 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_19\">\n    <path d=\"M 339.113793 94.473297 \nL 339.113793 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_20\">\n    <path d=\"M 266.958621 94.473297 \nL 339.113793 94.473297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_21\">\n    <path d=\"M 266.958621 22.318125 \nL 339.113793 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_4\">\n    <!-- 3 -->\n    <g transform=\"translate(299.218707 16.318125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \nQ 3050 2419 3304 2112 \nQ 3559 1806 3559 1356 \nQ 3559 666 3084 287 \nQ 2609 -91 1734 -91 \nQ 1441 -91 1130 -33 \nQ 819 25 488 141 \nL 488 750 \nQ 750 597 1062 519 \nQ 1375 441 1716 441 \nQ 2309 441 2620 675 \nQ 2931 909 2931 1356 \nQ 2931 1769 2642 2001 \nQ 2353 2234 1838 2234 \nL 1294 2234 \nL 1294 2753 \nL 1863 2753 \nQ 2328 2753 2575 2939 \nQ 2822 3125 2822 3475 \nQ 2822 3834 2567 4026 \nQ 2313 4219 1838 4219 \nQ 1578 4219 1281 4162 \nQ 984 4106 628 3988 \nL 628 4550 \nQ 988 4650 1302 4700 \nQ 1616 4750 1894 4750 \nQ 2613 4750 3031 4423 \nQ 3450 4097 3450 3541 \nQ 3450 3153 3228 2886 \nQ 3006 2619 2597 2516 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-33\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_5\">\n   <g id=\"patch_22\">\n    <path d=\"M 353.544828 94.473297 \nL 425.7 94.473297 \nL 425.7 22.318125 \nL 353.544828 22.318125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p3a0dc17057)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHlElEQVR4nO1dS28cRRCentfu7K4fMXHigB0HiIgEF7hzQgTBnZ/Ar+A35M8gIXFAQghxgwNCSAlCAUISiB1vEnu9j3lsDwekrfpqtZvsYjuVqL5Tt2umu9c1XVXzdXWP+9B9WgcGVQif9wAM0zClKIQpRSFMKQphSlEIU4pCxM+lV+eoGCcoSuKZ1wYhPkMuZtdG4vmqRaTvqV4XBcrGY7y1qqgsZFPtngJspiiEKUUhTCkKcTY+JYywmpIfce0WyFynDXW/QnXfQv9TJ9SuT/H5qrkvCoIgLP2kHI0qlB2PsN4bUDv9Acjq4ZD6LEqQBV74nyVhM0UhTCkKcSbmy4VoSiC0jXEIdTuDenmezFu+gearalC74xT78OKXRczSxEMPsuwA202YWQyFGeThsxtjO3WN9WXDZ5spCmFKUQhTikKciU+pPdpW55ntFTJph2vmj6om2veiw3xK8yk+hTErtaBrkmMM2WPmU4Ipf+hmy5ykepYLkW2mKIQpRSFMKQpxNjSLiN9rFt+7Eml0N0DKIxrRe4rz+D4xZu8pJbIzgbg08DmVQ8GO1JHwDXDj7CWAKdkJwWaKQphSFOLkzJekI1h4OEWzMNQlMrYuR3MWHZPdiYcNvJetNlYtNCXjDOs+pzFEhQifkznmS4bo86gTSbMsCZspCmFKUQhTikIs71OED5mXleJSEZ+62dR9ECHl4Sqy02EhKRkqjqVP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NJysReSSdY62yf2rn3ABO8xxfFXhvWZ7Eqjh5ZJ3OWZSKp/biPY7c3+pcHphSFMKUoxInto68FzRGOyMYnR2jv23vUbdXGbJE8xxCULxLK46Lyc/SHdAN9kytxPI0eNRQ9wD72klWo+xE/xRX7LNapz8bGCsjcAFljx08CFz53HmymKIQpRSFMKQpxcmezeHF8FFuZjHpIzzcfkaEu2phVGBb4nPCNQgm+BuB1DfwpYYA2PMppfM0DvLbfRBoo5Iy7eL3gR+2OO+ibkpY4jZytRC7ydQmbKQphSlGIpc3X1Amqcnqy5GbXR8Y27VK3HXEqXTIUieMxycMS+0x77DTtCs2nE+Pjp3Y3Holjp+ReflZNeyAKeO6gF3v+65ZIwOgx2ytWZuftsbeZohCmFIUwpSjE8iGxPEFV0gg8tO0dgyhilExWom1ND8WRhMns5yYaUJ/hQOwpFCFnwo5MbDewzaiQfozdN5ztx8LidD6iZjNFIUwpCvE/zJdInJAhMUtMkzLHvmXlhhguJ4nYN8j3VspvOVasXT//gzLxiFYJWzma2uZD7JOHyDK0DofMZPYxd1iG/p6HwQucomczRSFMKQphSlGIk2OJpY/hIbL8Ni9PhO6LBOqnfSgGGvKzrxPtuCPGl+yhLBJnAkT8+8XiG5XBnNVELxO8+Z5Iy2Z5sWFKUQhTikKc0Udt5n1JQfibkzoUW5yFAiOQ45l3Svc8nNK36W2mKIQpRSHOxnw9DyxiWk7JDC0LmykKYUpRCFOKQphSFMKUohCmFIUwpSiEKUUhTCkKYUpRiH8Bqj91EQiR5pkAAAAASUVORK5CYII=\" id=\"image0de05706c8\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"353.544828\" y=\"-21.753297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_23\">\n    <path d=\"M 353.544828 94.473297 \nL 353.544828 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_24\">\n    <path d=\"M 425.7 94.473297 \nL 425.7 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_25\">\n    <path d=\"M 353.544828 94.473297 \nL 425.7 94.473297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_26\">\n    <path d=\"M 353.544828 22.318125 \nL 425.7 22.318125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_5\">\n    <!-- 4 -->\n    <g transform=\"translate(385.804914 16.318125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-34\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_6\">\n   <g id=\"patch_27\">\n    <path d=\"M 7.2 185.193297 \nL 79.355172 185.193297 \nL 79.355172 113.038125 \nL 7.2 113.038125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p392988114d)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAIOklEQVR4nO1dSW/bVhAmKS5aI8my08RZkKRJGyBAi9x666X9B733F/Sf9dT+hpyKAA2QFs0CpEm8xrK1U1wksocCnPeNYCVSHHsQzHd646HIZw5n4byZR/sH+6fcUoiCc9ETUCxChSIQKhSBcC96AivBtpHOP093qJoiECoUgTgf8+WUgLQ9uqzt+8jzPfytaxzLzFc+z4iY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4gjhKKJR9PtoG3s4W+ZvtFn6Ypsl2XzVTNLMMrxnOMCwfRuRz0oT5DSNEdkP0Gf6AbZN1Qqkme4z3YKHn3rzGqRzFhUGFIhBnaL5YSGz0/2VMVR3D1Hlsta49wfC0ekS9LdEr9r2uTTJfew1cwXxbYSuRxk/59iEOWzA0d3itshfxYGD2ruAPK4dYW+wdUJYh6/WBBzuxMqimCIQKRSBUKAJxLgXe3H7OB0aoOMHQ1e5jtre8Q+FqhX2MrW30wOQV5C1sQ+UZO5+y7MdCAXpiZLhjXkRn9OOzPvo8QgeUGx9Vy2I8dlnvimqKQKhQBEKFIhDn8z36JfaTf/hl4UMw5o5VvHffBOvBtJ3Tj7Xfs41gfsr4/z+QT3nv3iva8/j5QIUiEOdjvs4Ky8xBjqZkzU3pREA1RSBUKAKhQhEIFYpAqFAEQoUiECoUgVChCIQKRSBUKALxHxQmwk7dKEHcAAAAAElFTkSuQmCC\" id=\"imagee14d20f310\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"7.2\" y=\"-112.473297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_28\">\n    <path d=\"M 7.2 185.193297 \nL 7.2 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_29\">\n    <path d=\"M 79.355172 185.193297 \nL 79.355172 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_30\">\n    <path d=\"M 7.2 185.193297 \nL 79.355172 185.193297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_31\">\n    <path d=\"M 7.2 113.038125 \nL 79.355172 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_6\">\n    <!-- 5 -->\n    <g transform=\"translate(39.460086 107.038125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-35\" d=\"M 691 4666 \nL 3169 4666 \nL 3169 4134 \nL 1269 4134 \nL 1269 2991 \nQ 1406 3038 1543 3061 \nQ 1681 3084 1819 3084 \nQ 2600 3084 3056 2656 \nQ 3513 2228 3513 1497 \nQ 3513 744 3044 326 \nQ 2575 -91 1722 -91 \nQ 1428 -91 1123 -41 \nQ 819 9 494 109 \nL 494 744 \nQ 775 591 1075 516 \nQ 1375 441 1709 441 \nQ 2250 441 2565 725 \nQ 2881 1009 2881 1497 \nQ 2881 1984 2565 2268 \nQ 2250 2553 1709 2553 \nQ 1456 2553 1204 2497 \nQ 953 2441 691 2322 \nL 691 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-35\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_7\">\n   <g id=\"patch_32\">\n    <path d=\"M 93.786207 185.193297 \nL 165.941379 185.193297 \nL 165.941379 113.038125 \nL 93.786207 113.038125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#pe07ffe9ffa)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHw0lEQVR4nO1dTW8bZRB+d73e9Tqx43wnbQgUVbSiFFWCS5G4ceYE/4CfwG/iyAUOCAmJCxcEqlSEEC0tLW1SYzuOP9efu8sBaed9xkrURHYyreY5zWTs3deZfWfmfd7ZXecT57PUKETBvewBKGahThEIdYpAqFMEQp0iEOoUgVCnCIQ6RSDUKQKhThEIdYpAqFMEQp0iEN5lD8A4DtNdppLd8dhwczmSXXZ9xTGoqa2fZjPGmPRyiXOdKQKhThEIdYpAXExOcXOoFoJMdkrLYEu310AfXillcn8HhztZsvJNgnkgaKO+dDjOZP/fLo6v0cIxdMmeTqdos/PPgnKPzhSBUKc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CS5Y4xnjnUefs+JPd6Zp3Jr48TrC3WKQKhTBOJi3h080+liNUmzOJxOWaMce0rpieCPAzzDo5xmMoG+j17BoU4RiIsJX2fBeUPHOZsUJEJnikCoUwRCnSIQ/wEGiJ4mC5IsDAAAAABJRU5ErkJggg==\" id=\"imageefe63296c2\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"93.786207\" y=\"-112.473297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_33\">\n    <path d=\"M 93.786207 185.193297 \nL 93.786207 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_34\">\n    <path d=\"M 165.941379 185.193297 \nL 165.941379 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_35\">\n    <path d=\"M 93.786207 185.193297 \nL 165.941379 185.193297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_36\">\n    <path d=\"M 93.786207 113.038125 \nL 165.941379 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_7\">\n    <!-- 6 -->\n    <g transform=\"translate(126.046293 107.038125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \nQ 1688 2584 1439 2293 \nQ 1191 2003 1191 1497 \nQ 1191 994 1439 701 \nQ 1688 409 2113 409 \nQ 2538 409 2786 701 \nQ 3034 994 3034 1497 \nQ 3034 2003 2786 2293 \nQ 2538 2584 2113 2584 \nz\nM 3366 4563 \nL 3366 3988 \nQ 3128 4100 2886 4159 \nQ 2644 4219 2406 4219 \nQ 1781 4219 1451 3797 \nQ 1122 3375 1075 2522 \nQ 1259 2794 1537 2939 \nQ 1816 3084 2150 3084 \nQ 2853 3084 3261 2657 \nQ 3669 2231 3669 1497 \nQ 3669 778 3244 343 \nQ 2819 -91 2113 -91 \nQ 1303 -91 875 529 \nQ 447 1150 447 2328 \nQ 447 3434 972 4092 \nQ 1497 4750 2381 4750 \nQ 2619 4750 2861 4703 \nQ 3103 4656 3366 4563 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-36\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_8\">\n   <g id=\"patch_37\">\n    <path d=\"M 180.372414 185.193297 \nL 252.527586 185.193297 \nL 252.527586 113.038125 \nL 180.372414 113.038125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p423047474d)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHuUlEQVR4nO1dW28bVRA+Z3d9v8Rx0tRJCYGUQkpBvFBAQkJIVOKRBwrP/DUk+AOAkHhB8MBTpaJS1AJqS6uSe9M0Tnxb27u8ec43KzaJsekUzfd0RmOvvf58vpmdM2fXXrFXYzNtWJvi85hp/9FvfXwtwGO+KAIzjp3THA7Rx2wTT/8nSUPKWSqeFpQUgVBSBCKY2JFY3LDZ7GjsFfLoq82MxlG1CL5BFV87LNJXjHz8DG9I2u/3MC4EBz2w/WabjHYHfFGrDXbcpffGg75B5/Tjjc4UgVBSBGJi8mV9H21Hvly5MsaYQaM2GreXCuBrn8H/Sa9GkhXjRxjPUZZsE2Wl8CgLdnEzMxoHuywNHwzwwE6KnEiXjZNqT0nKdKYIhJIiEEqKQIwfU9JKJxwp2hsFeJywinavTu8dFrF0Yvv02mGOxwm0My2KMX4T4w2Ph6c6tylAZ4pAKCkCMb58MUmKIyZRYUi+dhdcfpPszFEOfT38n8SBc9wqXl1HEclMz2TAF7TxOIN9suMcypXHKszumfCqdcwz5ClAZ4pAKCkCoaQIxOSqxDFb6etT6SJut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Uplem92E2XQc/bnx2zFMr+Pq37b67XR+NrqKvjWcptgL58lXdp7bgl8lT+payZgzelQQTZaJf5fQUkRCCVFIFJjSuIWhE7pxFYw5RzMYiml06DSfavB98ZT6jioYBrphZiGH67QcQrbLD09ING2LB1tz7Fg5XQv7oTYKH65gGWWCzO7o/HDRgN8PSdFzmzhb2AOj9Dmt0E8IXSmCISSIhBJ+XKv4vnDADKUnsZF3NMRzqK0uHdNbS+htEQr1DS9PP8EfAtFvGpvhvQ5m02UncdH5It6KFd+Afe9vHGO0t53ynhFX/dwBXGlsEfHLWNq3XFS9mIFU/REVcPde6Mrj882lBSBUFIEIhlT0rSPxxj3bcwXZZw7oRaw3lCrUEfI5fkH4PugegvslYBKHpFh6XJEGh4aVmax2Pmy7FMJZDHAVPavAX6/buSUkDwWDx1XzG5R5fHGQrdMdYoNRTpTBEJJEQglRSDSS/f8gWLOw2A8dhfs3D5ep5S2ie9BCfV+P0ObdL43F8DXGuJxLpXWR+O1HK4QznkUmyoWr0uKFr+7G2Fuh/gQmx/buDH1hy36TpkdXKLIHlKMsd3xyijHQWeKQCgpAmFP9ZxHz2miY03b3gyWQOI6PcgmXGAV5DMkfZ059sCBGtr9qvMAggJLT/NOKstSVxMw2zo2ezhBsI8qXtim71C9jzJYvkeVYH/zEX4f1tgRuXvwtczybENJEQglRSBO1+Dt7AuP+C2XEreIoua47Dqmlbk8ldxrOVbuZrEqdvdL+inN1cfdysrZn2hZWcV28bsbZzNQnDhPSq6H7Jx5A/q40JkiEEqKQEzuoTZs6oLdYdLSZA0GKUg8Cv2ESO3rPa5LTh99ruBQUgRCSRGI6d1t1QXX6FOswo3bJP0sQ2eKQCgpAqGkCISSIhBKikAoKQKhpAiEkiIQSopAKCkCoaQIhJIiEEqKQCgpAqGkCISSIhBKikD8DQKJKva9517MAAAAAElFTkSuQmCC\" id=\"imagea909193a1f\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"180.372414\" y=\"-112.473297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_38\">\n    <path d=\"M 180.372414 185.193297 \nL 180.372414 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_39\">\n    <path d=\"M 252.527586 185.193297 \nL 252.527586 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_40\">\n    <path d=\"M 180.372414 185.193297 \nL 252.527586 185.193297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_41\">\n    <path d=\"M 180.372414 113.038125 \nL 252.527586 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_8\">\n    <!-- 7 -->\n    <g transform=\"translate(212.6325 107.038125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-37\" d=\"M 525 4666 \nL 3525 4666 \nL 3525 4397 \nL 1831 0 \nL 1172 0 \nL 2766 4134 \nL 525 4134 \nL 525 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-37\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_9\">\n   <g id=\"patch_42\">\n    <path d=\"M 266.958621 185.193297 \nL 339.113793 185.193297 \nL 339.113793 113.038125 \nL 266.958621 113.038125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p3423f07405)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHzklEQVR4nO1dS2/bRhDmkhIlUdbDj9hx4lcejRvk1F4K9JoiPRToqT+u1/6TtGgvRdEeirZGgqRIbSt+JZKsNymSPRTg7DeGlTqR7Ek732nHQ5E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SrCwx74fUncf3C0qKQCgpAjGznsdkaKVE2JcVcpY9rbH3m7gx7i6+jmnH8Od4HXT+FoXhn9T+BN16HncXhyn5kb0QC8Ufv7oHcq9D/qd4jM9t+ZB8Q+EEdxPdTg/kxPKrF2ko0pkiEEqKQJhL+fS5y4sqyGq6AWZoTR1X5uEaFca17mIW9tSqzQtvYjg6v4RheM4j89E6xWsmDWwTn3tBz2rtOWYqgl06r3uEIXrSRfOVDsh8aTHeew4lRSCUFIG4HJ8y8Q74hwwwBQJ9LiX0KaZC4XNSQb+QsAJAG+4Q/YTpj5hs7Tz2sFDczn7zD6VN6xvEOlMEQkkRCCVFIC7ne/STwLcAovB8uYfrAOcEUykTYfmuMwmPK/7+PIfOFIFQUgTi6s3XZUGYiZoEnSkCoaQIhJIiEEqKQCgpAqGkCISSIhBKikAoKQKhpAjE34FckZWxDkHqAAAAAElFTkSuQmCC\" id=\"imageb2a43abd28\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"266.958621\" y=\"-112.473297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_43\">\n    <path d=\"M 266.958621 185.193297 \nL 266.958621 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_44\">\n    <path d=\"M 339.113793 185.193297 \nL 339.113793 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_45\">\n    <path d=\"M 266.958621 185.193297 \nL 339.113793 185.193297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_46\">\n    <path d=\"M 266.958621 113.038125 \nL 339.113793 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_9\">\n    <!-- 8 -->\n    <g transform=\"translate(299.218707 107.038125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \nQ 1584 2216 1326 1975 \nQ 1069 1734 1069 1313 \nQ 1069 891 1326 650 \nQ 1584 409 2034 409 \nQ 2484 409 2743 651 \nQ 3003 894 3003 1313 \nQ 3003 1734 2745 1975 \nQ 2488 2216 2034 2216 \nz\nM 1403 2484 \nQ 997 2584 770 2862 \nQ 544 3141 544 3541 \nQ 544 4100 942 4425 \nQ 1341 4750 2034 4750 \nQ 2731 4750 3128 4425 \nQ 3525 4100 3525 3541 \nQ 3525 3141 3298 2862 \nQ 3072 2584 2669 2484 \nQ 3125 2378 3379 2068 \nQ 3634 1759 3634 1313 \nQ 3634 634 3220 271 \nQ 2806 -91 2034 -91 \nQ 1263 -91 848 271 \nQ 434 634 434 1313 \nQ 434 1759 690 2068 \nQ 947 2378 1403 2484 \nz\nM 1172 3481 \nQ 1172 3119 1398 2916 \nQ 1625 2713 2034 2713 \nQ 2441 2713 2670 2916 \nQ 2900 3119 2900 3481 \nQ 2900 3844 2670 4047 \nQ 2441 4250 2034 4250 \nQ 1625 4250 1398 4047 \nQ 1172 3844 1172 3481 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-38\"/>\n    </g>\n   </g>\n  </g>\n  <g id=\"axes_10\">\n   <g id=\"patch_47\">\n    <path d=\"M 353.544828 185.193297 \nL 425.7 185.193297 \nL 425.7 113.038125 \nL 353.544828 113.038125 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p5f2682c122)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAAGUAAABlCAYAAABUfC3PAAAHSklEQVR4nO1dSW8cVRDudfbFM05sJzZ2IgxIORAUEJuEEAikXEFwQeIHIf4FAnHjB3DjAhJCRAEhspCQOIuyeWzPvnU3B6Su+mqwFQ8zTsmq71Sl6p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SGPIPcRGvcptvLZyg7pZwru4Khk3qJE87uFygT0o7RjDSFGIo3Ffh4Hc9/K0j7SVezAl2CmpiXiWljPCagQ8plaerjqnR9Ny2ExRCCNFIYwUhXg2J3gfBFmuGQ3/U3Ycx3HEgwSOC2ymKISRohBGikIYKQphpCiEkaIQRopCGCkKYaQohJGiEEaKQhgpCmGkKISRohBGikIYKQphpCjEP4KKCX3KEuzcAAAAAElFTkSuQmCC\" id=\"imagee633bd004a\" transform=\"scale(1 -1) translate(0 -72.72)\" x=\"353.544828\" y=\"-112.473297\" width=\"72.72\" height=\"72.72\"/>\n   </g>\n   <g id=\"patch_48\">\n    <path d=\"M 353.544828 185.193297 \nL 353.544828 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_49\">\n    <path d=\"M 425.7 185.193297 \nL 425.7 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_50\">\n    <path d=\"M 353.544828 185.193297 \nL 425.7 185.193297 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_51\">\n    <path d=\"M 353.544828 113.038125 \nL 425.7 113.038125 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"text_10\">\n    <!-- 9 -->\n    <g transform=\"translate(385.804914 107.038125) scale(0.12 -0.12)\">\n     <defs>\n      <path id=\"DejaVuSans-39\" d=\"M 703 97 \nL 703 672 \nQ 941 559 1184 500 \nQ 1428 441 1663 441 \nQ 2288 441 2617 861 \nQ 2947 1281 2994 2138 \nQ 2813 1869 2534 1725 \nQ 2256 1581 1919 1581 \nQ 1219 1581 811 2004 \nQ 403 2428 403 3163 \nQ 403 3881 828 4315 \nQ 1253 4750 1959 4750 \nQ 2769 4750 3195 4129 \nQ 3622 3509 3622 2328 \nQ 3622 1225 3098 567 \nQ 2575 -91 1691 -91 \nQ 1453 -91 1209 -44 \nQ 966 3 703 97 \nz\nM 1959 2075 \nQ 2384 2075 2632 2365 \nQ 2881 2656 2881 3163 \nQ 2881 3666 2632 3958 \nQ 2384 4250 1959 4250 \nQ 1534 4250 1286 3958 \nQ 1038 3666 1038 3163 \nQ 1038 2656 1286 2365 \nQ 1534 2075 1959 2075 \nz\n\" transform=\"scale(0.015625)\"/>\n     </defs>\n     <use xlink:href=\"#DejaVuSans-39\"/>\n    </g>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"pce1c0e498e\">\n   <rect x=\"7.2\" y=\"22.318125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p23e96ee7a4\">\n   <rect x=\"93.786207\" y=\"22.318125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p2cd82a673f\">\n   <rect x=\"180.372414\" y=\"22.318125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"pf5288babcd\">\n   <rect x=\"266.958621\" y=\"22.318125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p3a0dc17057\">\n   <rect x=\"353.544828\" y=\"22.318125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p392988114d\">\n   <rect x=\"7.2\" y=\"113.038125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"pe07ffe9ffa\">\n   <rect x=\"93.786207\" y=\"113.038125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p423047474d\">\n   <rect x=\"180.372414\" y=\"113.038125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p3423f07405\">\n   <rect x=\"266.958621\" y=\"113.038125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n  <clipPath id=\"p5f2682c122\">\n   <rect x=\"353.544828\" y=\"113.038125\" width=\"72.155172\" height=\"72.155172\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {}
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-5 fw=all -->\n",
    "\n",
    "The blur is the naive assumption made visible: the model knows each pixel's marginal firing rate but nothing about how pixels co-occur, so every sharp stroke smears into an average.\n",
    "\n",
    "### Classifying and Evaluating\n",
    "\n",
    "Prediction sums log-likelihoods per the equation. We precompute $\\log P_{xy}$, $\\log(1-P_{xy})$, and $\\log P_y$, then score a batch of images at once: a pixel that is on contributes $\\log P_{xy}$, a pixel that is off contributes $\\log(1-P_{xy})$, and the prior is added in. The winning class is the $\\mathrm{argmax}$. Before reporting the accuracy, the cell also puts numbers to the underflow story that motivated log space, by checking what the *raw* products of the equation would have done in single and double precision."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "naive-bayes-predict"
   },
   "source": [
    "log_P_xy, log_P_xy_neg = np.log(P_xy), np.log(1 - P_xy)\n",
    "log_P_y = np.log(P_y)\n",
    "\n",
    "def scores(X):                       # log p(y) + sum_i log p(x_i|y), per class\n",
    "    X = X.reshape(-1, 1, 28, 28)                       # (m, 1, 28, 28)\n",
    "    return (X * log_P_xy + (1 - X) * log_P_xy_neg).reshape(\n",
    "        len(X), 10, -1).sum(axis=2) + log_P_y\n",
    "\n",
    "def predict(X):\n",
    "    return scores(X).argmax(axis=1)\n",
    "\n",
    "s = scores(X_test)                   # measure what the raw products would do\n",
    "print(f'float32 underflow: {(np.exp(s.astype(np.float32)) == 0).mean():.1%}'\n",
    "      f' of class scores; smallest float64 survivor'\n",
    "      f' = 1e{int(s[np.exp(s) > 0].min() / np.log(10))}')\n",
    "float((predict(X_test) == Y_test).mean())              # Test accuracy"
   ],
   "execution_count": 5,
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "float32 underflow: 99.1% of class scores; smallest float64 survivor = 1e-323\n"
     ]
    },
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "0.8427"
     },
     "metadata": {},
     "execution_count": 5
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-6 fw=all -->\n",
    "\n",
    "Naive Bayes lands around $84\\%$ accuracy, far above the $10\\%$ of random guessing, from a model that is nothing but ten averaged templates and a counting pass over the data. Modern networks reach error rates below $1\\%$, and the gap traces back to the naive assumption: pixels in a real digit are *not* independent given the class, and pretending otherwise ignores everything their joint behavior could reveal. Naive Bayes shows how far a simple probabilistic idea and a single counting pass can take you, and exactly where a wrong independence assumption stops you.\n",
    "\n",
    "Images are in fact the *hard* case for the naive assumption, because adjacent pixels are so tightly coupled. Its canonical home is the opposite regime: **bag-of-words text classification**, where each feature records whether a given word appears in a document (the *Bernoulli* event model; the *multinomial* variant counts occurrences instead) [@Manning.Raghavan.Schutze.2008]. There the independence story, while still not literally true, is far closer to holding: the presence of any one word out of a vocabulary of tens of thousands says comparatively little about the presence of most others, where neighboring pixels almost always agree. The same counting-and-argmax recipe therefore makes naive Bayes a strong, famously cheap baseline for topic labelling and spam filtering, which it dominated for decades [@Sahami.Dumais.Heckerman.ea.1998].\n",
    "\n",
    "### Calibration\n",
    "\n",
    "Three questions remain about the accuracy number, and a generative classifier with a knowingly false assumption is exactly the model to ask them of: how *precise* is the $84.27\\%$; *which* mistakes make up the missing $16\\%$; and can the model's own confidence be *trusted*? Each takes a few lines.\n",
    "\n",
    "First, precision. The test accuracy is an estimate computed from $10{,}000$ random test examples, so it carries a standard error, and the bootstrap of that section delivers it exactly as promised there: resample the test indices with replacement, recompute the accuracy on each resample, and read off the spread."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "mdl-naive-bayes-calibration-1"
   },
   "source": [
    "rng = np.random.default_rng(0)\n",
    "correct = (predict(X_test) == Y_test)                  # per-example 0/1 outcomes\n",
    "idx = rng.integers(0, len(correct), (1000, len(correct)))  # resampled test sets\n",
    "boot = correct[idx].mean(axis=1)                       # one accuracy per resample\n",
    "lo, hi = np.percentile(boot, [2.5, 97.5])\n",
    "print(f'test accuracy = {correct.mean():.4f}, '\n",
    "      f'bootstrap 95% CI = ({lo:.4f}, {hi:.4f})')"
   ],
   "execution_count": 6,
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "test accuracy = 0.8427, bootstrap 95% CI = (0.8354, 0.8496)\n"
     ]
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-7 fw=all -->\n",
    "\n",
    "The error bar spans about $\\pm0.7$ accuracy points: the \"$84.27\\%$\" is really \"$84.3\\%\\pm0.7$\", and the third decimal is noise. One caution about comparisons: this interval quantifies the uncertainty in *our model's* accuracy, not the gap to a competitor. Deciding whether another model on the same test set is genuinely better calls for a *paired* comparison (bootstrap the accuracy *difference* example by example, or use McNemar's test); because the two models' errors are correlated, a competitor whose accuracy falls inside our interval can still be significantly better. Second, the mistakes. Tallying predictions against truth in a *confusion matrix*, with one row per true digit and one column per predicted digit, turns the flat error rate into structure."
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "mdl-naive-bayes-calibration-2"
   },
   "source": [
    "conf = np.zeros((10, 10), dtype=int)\n",
    "np.add.at(conf, (Y_test, predict(X_test)), 1)          # tally (true, predicted)\n",
    "off = conf - np.diag(np.diag(conf))                    # errors only\n",
    "worst = np.dstack(np.unravel_index(\n",
    "    np.argsort(off, axis=None)[::-1], (10, 10)))[0][:4]\n",
    "print('most confused true->predicted:',\n",
    "      ', '.join(f'{t}->{p} ({off[t, p]})' for t, p in worst))\n",
    "d2l.plt.imshow(conf, cmap='Blues')\n",
    "d2l.plt.xlabel('predicted digit')\n",
    "d2l.plt.ylabel('true digit')\n",
    "d2l.plt.colorbar();"
   ],
   "execution_count": 7,
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "most confused true->predicted: 4->9 (138), 5->3 (106), 8->3 (68), 7->9 (67)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"371.164225pt\" height=\"310.86825pt\" viewBox=\"0 0 371.164225 310.86825\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n <metadata>\n  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2026-07-19T13:55:23.084760</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.10.8, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 310.86825 \nL 371.164225 310.86825 \nL 371.164225 0 \nL 0 0 \nz\n\" style=\"fill: #ffffff\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 34.240625 273.312 \nL 300.352625 273.312 \nL 300.352625 7.2 \nL 34.240625 7.2 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <g clip-path=\"url(#p1e6764b5e6)\">\n    <image xlink:href=\"data:image/png;base64,\niVBORw0K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4gTcoA4IQeIE3KAOCEHiBNygDghB4gTcoA4IQeIE3KAOCEHiBNygDghB4gTcoA4IQeIE3KAOCEHiBNygDghB4gTcoC488/e/nj2hsG/vno8ewL/R57fXWdPGLxyXu8b6nxabxM/jl8OIE7IAeKEHCBOyAHihBwgTsgB4oQcIE7IAeKEHCBOyAHihBwgTsgB4oQcIE7IAeKEHCBOyAHihBwgTsgB4oQcIE7IAeKEHCBOyAHihBwgTsgB4oQcIE7IAeKEHCBOyAHihBwgTsgB4oQcIE7IAeKEHCBOyAHihBwgTsgB4v4DBsaLvII6afcAAAAASUVORK5CYII=\" id=\"image5fdb40a683\" transform=\"scale(1 -1) translate(0 -266.4)\" x=\"34.240625\" y=\"-6.912\" width=\"266.4\" height=\"266.4\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path id=\"m3bc6d6eeb4\" d=\"M 0 0 \nL 0 3.5 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m3bc6d6eeb4\" x=\"47.546225\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0 -->\n      <g transform=\"translate(44.364975 287.910438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \nQ 1547 4250 1301 3770 \nQ 1056 3291 1056 2328 \nQ 1056 1369 1301 889 \nQ 1547 409 2034 409 \nQ 2525 409 2770 889 \nQ 3016 1369 3016 2328 \nQ 3016 3291 2770 3770 \nQ 2525 4250 2034 4250 \nz\nM 2034 4750 \nQ 2819 4750 3233 4129 \nQ 3647 3509 3647 2328 \nQ 3647 1150 3233 529 \nQ 2819 -91 2034 -91 \nQ 1250 -91 836 529 \nQ 422 1150 422 2328 \nQ 422 3509 836 4129 \nQ 1250 4750 2034 4750 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use xlink:href=\"#m3bc6d6eeb4\" x=\"100.768625\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 2 -->\n      <g transform=\"translate(97.587375 287.910438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \nL 3431 531 \nL 3431 0 \nL 469 0 \nL 469 531 \nQ 828 903 1448 1529 \nQ 2069 2156 2228 2338 \nQ 2531 2678 2651 2914 \nQ 2772 3150 2772 3378 \nQ 2772 3750 2511 3984 \nQ 2250 4219 1831 4219 \nQ 1534 4219 1204 4116 \nQ 875 4013 500 3803 \nL 500 4441 \nQ 881 4594 1212 4672 \nQ 1544 4750 1819 4750 \nQ 2544 4750 2975 4387 \nQ 3406 4025 3406 3419 \nQ 3406 3131 3298 2873 \nQ 3191 2616 2906 2266 \nQ 2828 2175 2409 1742 \nQ 1991 1309 1228 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-32\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use xlink:href=\"#m3bc6d6eeb4\" x=\"153.991025\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 4 -->\n      <g transform=\"translate(150.809775 287.910438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \nL 825 1625 \nL 2419 1625 \nL 2419 4116 \nz\nM 2253 4666 \nL 3047 4666 \nL 3047 1625 \nL 3713 1625 \nL 3713 1100 \nL 3047 1100 \nL 3047 0 \nL 2419 0 \nL 2419 1100 \nL 313 1100 \nL 313 1709 \nL 2253 4666 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-34\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use xlink:href=\"#m3bc6d6eeb4\" x=\"207.213425\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 6 -->\n      <g transform=\"translate(204.032175 287.910438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \nQ 1688 2584 1439 2293 \nQ 1191 2003 1191 1497 \nQ 1191 994 1439 701 \nQ 1688 409 2113 409 \nQ 2538 409 2786 701 \nQ 3034 994 3034 1497 \nQ 3034 2003 2786 2293 \nQ 2538 2584 2113 2584 \nz\nM 3366 4563 \nL 3366 3988 \nQ 3128 4100 2886 4159 \nQ 2644 4219 2406 4219 \nQ 1781 4219 1451 3797 \nQ 1122 3375 1075 2522 \nQ 1259 2794 1537 2939 \nQ 1816 3084 2150 3084 \nQ 2853 3084 3261 2657 \nQ 3669 2231 3669 1497 \nQ 3669 778 3244 343 \nQ 2819 -91 2113 -91 \nQ 1303 -91 875 529 \nQ 447 1150 447 2328 \nQ 447 3434 972 4092 \nQ 1497 4750 2381 4750 \nQ 2619 4750 2861 4703 \nQ 3103 4656 3366 4563 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-36\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use xlink:href=\"#m3bc6d6eeb4\" x=\"260.435825\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 8 -->\n      <g transform=\"translate(257.254575 287.910438) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \nQ 1584 2216 1326 1975 \nQ 1069 1734 1069 1313 \nQ 1069 891 1326 650 \nQ 1584 409 2034 409 \nQ 2484 409 2743 651 \nQ 3003 894 3003 1313 \nQ 3003 1734 2745 1975 \nQ 2488 2216 2034 2216 \nz\nM 1403 2484 \nQ 997 2584 770 2862 \nQ 544 3141 544 3541 \nQ 544 4100 942 4425 \nQ 1341 4750 2034 4750 \nQ 2731 4750 3128 4425 \nQ 3525 4100 3525 3541 \nQ 3525 3141 3298 2862 \nQ 3072 2584 2669 2484 \nQ 3125 2378 3379 2068 \nQ 3634 1759 3634 1313 \nQ 3634 634 3220 271 \nQ 2806 -91 2034 -91 \nQ 1263 -91 848 271 \nQ 434 634 434 1313 \nQ 434 1759 690 2068 \nQ 947 2378 1403 2484 \nz\nM 1172 3481 \nQ 1172 3119 1398 2916 \nQ 1625 2713 2034 2713 \nQ 2441 2713 2670 2916 \nQ 2900 3119 2900 3481 \nQ 2900 3844 2670 4047 \nQ 2441 4250 2034 4250 \nQ 1625 4250 1398 4047 \nQ 1172 3844 1172 3481 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-38\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_6\">\n     <!-- predicted digit -->\n     <g transform=\"translate(130.903656 301.588562) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \nL 1159 -1331 \nL 581 -1331 \nL 581 3500 \nL 1159 3500 \nL 1159 2969 \nQ 1341 3281 1617 3432 \nQ 1894 3584 2278 3584 \nQ 2916 3584 3314 3078 \nQ 3713 2572 3713 1747 \nQ 3713 922 3314 415 \nQ 2916 -91 2278 -91 \nQ 1894 -91 1617 61 \nQ 1341 213 1159 525 \nz\nM 3116 1747 \nQ 3116 2381 2855 2742 \nQ 2594 3103 2138 3103 \nQ 1681 3103 1420 2742 \nQ 1159 2381 1159 1747 \nQ 1159 1113 1420 752 \nQ 1681 391 2138 391 \nQ 2594 391 2855 752 \nQ 3116 1113 3116 1747 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \nQ 2534 3019 2420 3045 \nQ 2306 3072 2169 3072 \nQ 1681 3072 1420 2755 \nQ 1159 2438 1159 1844 \nL 1159 0 \nL 581 0 \nL 581 3500 \nL 1159 3500 \nL 1159 2956 \nQ 1341 3275 1631 3429 \nQ 1922 3584 2338 3584 \nQ 2397 3584 2469 3576 \nQ 2541 3569 2628 3553 \nL 2631 2963 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \nL 3597 1613 \nL 953 1613 \nQ 991 1019 1311 708 \nQ 1631 397 2203 397 \nQ 2534 397 2845 478 \nQ 3156 559 3463 722 \nL 3463 178 \nQ 3153 47 2828 -22 \nQ 2503 -91 2169 -91 \nQ 1331 -91 842 396 \nQ 353 884 353 1716 \nQ 353 2575 817 3079 \nQ 1281 3584 2069 3584 \nQ 2775 3584 3186 3129 \nQ 3597 2675 3597 1894 \nz\nM 3022 2063 \nQ 3016 2534 2758 2815 \nQ 2500 3097 2075 3097 \nQ 1594 3097 1305 2825 \nQ 1016 2553 972 2059 \nL 3022 2063 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-64\" d=\"M 2906 2969 \nL 2906 4863 \nL 3481 4863 \nL 3481 0 \nL 2906 0 \nL 2906 525 \nQ 2725 213 2448 61 \nQ 2172 -91 1784 -91 \nQ 1150 -91 751 415 \nQ 353 922 353 1747 \nQ 353 2572 751 3078 \nQ 1150 3584 1784 3584 \nQ 2172 3584 2448 3432 \nQ 2725 3281 2906 2969 \nz\nM 947 1747 \nQ 947 1113 1208 752 \nQ 1469 391 1925 391 \nQ 2381 391 2643 752 \nQ 2906 1113 2906 1747 \nQ 2906 2381 2643 2742 \nQ 2381 3103 1925 3103 \nQ 1469 3103 1208 2742 \nQ 947 2381 947 1747 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \nL 1178 3500 \nL 1178 0 \nL 603 0 \nL 603 3500 \nz\nM 603 4863 \nL 1178 4863 \nL 1178 4134 \nL 603 4134 \nL 603 4863 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \nL 3122 2828 \nQ 2878 2963 2633 3030 \nQ 2388 3097 2138 3097 \nQ 1578 3097 1268 2742 \nQ 959 2388 959 1747 \nQ 959 1106 1268 751 \nQ 1578 397 2138 397 \nQ 2388 397 2633 464 \nQ 2878 531 3122 666 \nL 3122 134 \nQ 2881 22 2623 -34 \nQ 2366 -91 2075 -91 \nQ 1284 -91 818 406 \nQ 353 903 353 1747 \nQ 353 2603 823 3093 \nQ 1294 3584 2113 3584 \nQ 2378 3584 2631 3529 \nQ 2884 3475 3122 3366 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \nL 1172 3500 \nL 2356 3500 \nL 2356 3053 \nL 1172 3053 \nL 1172 1153 \nQ 1172 725 1289 603 \nQ 1406 481 1766 481 \nL 2356 481 \nL 2356 0 \nL 1766 0 \nQ 1100 0 847 248 \nQ 594 497 594 1153 \nL 594 3053 \nL 172 3053 \nL 172 3500 \nL 594 3500 \nL 594 4494 \nL 1172 4494 \nz\n\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n       <path id=\"DejaVuSans-67\" d=\"M 2906 1791 \nQ 2906 2416 2648 2759 \nQ 2391 3103 1925 3103 \nQ 1463 3103 1205 2759 \nQ 947 2416 947 1791 \nQ 947 1169 1205 825 \nQ 1463 481 1925 481 \nQ 2391 481 2648 825 \nQ 2906 1169 2906 1791 \nz\nM 3481 434 \nQ 3481 -459 3084 -895 \nQ 2688 -1331 1869 -1331 \nQ 1566 -1331 1297 -1286 \nQ 1028 -1241 775 -1147 \nL 775 -588 \nQ 1028 -725 1275 -790 \nQ 1522 -856 1778 -856 \nQ 2344 -856 2625 -561 \nQ 2906 -266 2906 331 \nL 2906 616 \nQ 2728 306 2450 153 \nQ 2172 0 1784 0 \nQ 1141 0 747 490 \nQ 353 981 353 1791 \nQ 353 2603 747 3093 \nQ 1141 3584 1784 3584 \nQ 2172 3584 2450 3431 \nQ 2728 3278 2906 2969 \nL 2906 3500 \nL 3481 3500 \nL 3481 434 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-70\"/>\n      <use xlink:href=\"#DejaVuSans-72\" transform=\"translate(63.476562 0)\"/>\n      <use xlink:href=\"#DejaVuSans-65\" transform=\"translate(102.339844 0)\"/>\n      <use xlink:href=\"#DejaVuSans-64\" transform=\"translate(163.863281 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(227.339844 0)\"/>\n      <use xlink:href=\"#DejaVuSans-63\" transform=\"translate(255.123047 0)\"/>\n      <use xlink:href=\"#DejaVuSans-74\" transform=\"translate(310.103516 0)\"/>\n      <use xlink:href=\"#DejaVuSans-65\" transform=\"translate(349.3125 0)\"/>\n      <use xlink:href=\"#DejaVuSans-64\" transform=\"translate(410.835938 0)\"/>\n      <use xlink:href=\"#DejaVuSans-20\" transform=\"translate(474.3125 0)\"/>\n      <use xlink:href=\"#DejaVuSans-64\" transform=\"translate(506.099609 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(569.576172 0)\"/>\n      <use xlink:href=\"#DejaVuSans-67\" transform=\"translate(597.359375 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(660.835938 0)\"/>\n      <use xlink:href=\"#DejaVuSans-74\" transform=\"translate(688.619141 0)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_6\">\n      <defs>\n       <path id=\"m84b1a9a0ab\" d=\"M 0 0 \nL -3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#m84b1a9a0ab\" x=\"34.240625\" y=\"20.5056\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 0 -->\n      <g transform=\"translate(20.878125 24.304819) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_7\">\n      <g>\n       <use xlink:href=\"#m84b1a9a0ab\" x=\"34.240625\" y=\"73.728\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 2 -->\n      <g transform=\"translate(20.878125 77.527219) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_8\">\n      <g>\n       <use xlink:href=\"#m84b1a9a0ab\" x=\"34.240625\" y=\"126.9504\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 4 -->\n      <g transform=\"translate(20.878125 130.749619) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-34\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_9\">\n      <g>\n       <use xlink:href=\"#m84b1a9a0ab\" x=\"34.240625\" y=\"180.1728\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 6 -->\n      <g transform=\"translate(20.878125 183.972019) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-36\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_10\">\n      <g>\n       <use xlink:href=\"#m84b1a9a0ab\" x=\"34.240625\" y=\"233.3952\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 8 -->\n      <g transform=\"translate(20.878125 237.194419) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-38\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"text_12\">\n     <!-- true digit -->\n     <g transform=\"translate(14.798437 163.192719) rotate(-90) scale(0.1 -0.1)\">\n      <defs>\n       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \nL 544 3500 \nL 1119 3500 \nL 1119 1403 \nQ 1119 906 1312 657 \nQ 1506 409 1894 409 \nQ 2359 409 2629 706 \nQ 2900 1003 2900 1516 \nL 2900 3500 \nL 3475 3500 \nL 3475 0 \nL 2900 0 \nL 2900 538 \nQ 2691 219 2414 64 \nQ 2138 -91 1772 -91 \nQ 1169 -91 856 284 \nQ 544 659 544 1381 \nz\nM 1991 3584 \nL 1991 3584 \nz\n\" transform=\"scale(0.015625)\"/>\n      </defs>\n      <use xlink:href=\"#DejaVuSans-74\"/>\n      <use xlink:href=\"#DejaVuSans-72\" transform=\"translate(39.208984 0)\"/>\n      <use xlink:href=\"#DejaVuSans-75\" transform=\"translate(80.322266 0)\"/>\n      <use xlink:href=\"#DejaVuSans-65\" transform=\"translate(143.701172 0)\"/>\n      <use xlink:href=\"#DejaVuSans-20\" transform=\"translate(205.224609 0)\"/>\n      <use xlink:href=\"#DejaVuSans-64\" transform=\"translate(237.011719 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(300.488281 0)\"/>\n      <use xlink:href=\"#DejaVuSans-67\" transform=\"translate(328.271484 0)\"/>\n      <use xlink:href=\"#DejaVuSans-69\" transform=\"translate(391.748047 0)\"/>\n      <use xlink:href=\"#DejaVuSans-74\" transform=\"translate(419.53125 0)\"/>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_3\">\n    <path d=\"M 34.240625 273.312 \nL 34.240625 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path d=\"M 300.352625 273.312 \nL 300.352625 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path d=\"M 34.240625 273.312 \nL 300.352625 273.312 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path d=\"M 34.240625 7.2 \nL 300.352625 7.2 \n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n  <g id=\"axes_2\">\n   <g id=\"patch_7\">\n    <path d=\"M 318.208625 273.312 \nL 331.514225 273.312 \nL 331.514225 7.2 \nL 318.208625 7.2 \nz\n\" style=\"fill: #ffffff\"/>\n   </g>\n   <image xlink:href=\"data:image/png;base64,\niVBORw0KGgoAAAANSUhEUgAAABIAAAFyCAYAAAD4TYq5AAABuElEQVR4nO2cQYrlMBQDPU3uf91ZNCR9BGVRhEJIBxApy5YfIf//+//7PAfQD2FyzjkX8zznXM9hnC7Ih1wjzEiIttSikRANSk2HVlxsSjRGHBpVI0vthZGxs1uLrfk6OkstG/UWG9jZjJSdvdSCilNT3rSUkRBtqUUjIZostRVb1q6jrKX2wmjFlo12HUUttSwutRuKbZ2dxaHdvWhLLRs1v2Kl1ujWxV+8s5faCyPG51wP9EhgsVFGPrSllo18aL5DS83Z29lZ5M5mjMgZsnb0w9C4Odu3Rr2TP5aasGo5NMaIRLMdWuEaUYdWiNZ7aJtvEdsQgU1sxWuk3Nm1h9ZYtdQtgtgo4y++jrhXGr1owtQwI9ucLSw230271F4YITbVo986O0uI5kttXyBErbNfGSE+zZ1dnJqw2KrRZPEPLcuHptzZmNHQgoaW5UPbGmUJ0W5o9BeiFaemu7KV04gtfu7nizq04tQwtMX/ndEObVZzaju0Uc3xL7XvjIRoi/87IyGa8D8QelM7XGrM137YE5FrNLSvjIp3djFa984eWpARTfdiXFe11fEPLWloWT60TSNZGNofwUEboP2/onIAAAAASUVORK5CYII=\" id=\"imageb8c33bcf6a\" transform=\"scale(1 -1) translate(0 -266.4)\" x=\"318.24\" y=\"-6.48\" width=\"12.96\" height=\"266.4\"/>\n   <g id=\"matplotlib.axis_3\"/>\n   <g id=\"matplotlib.axis_4\">\n    <g id=\"ytick_6\">\n     <g id=\"line2d_11\">\n      <defs>\n       <path id=\"ma612e5593a\" d=\"M 0 0 \nL 3.5 0 \n\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </defs>\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"273.312\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 0 -->\n      <g transform=\"translate(338.514225 277.111219) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-30\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_7\">\n     <g id=\"line2d_12\">\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"224.304265\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 200 -->\n      <g transform=\"translate(338.514225 228.103484) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-32\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(127.246094 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_8\">\n     <g id=\"line2d_13\">\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"175.29653\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- 400 -->\n      <g transform=\"translate(338.514225 179.095749) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-34\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(127.246094 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_9\">\n     <g id=\"line2d_14\">\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"126.288796\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_16\">\n      <!-- 600 -->\n      <g transform=\"translate(338.514225 130.088014) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-36\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(127.246094 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_10\">\n     <g id=\"line2d_15\">\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"77.281061\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_17\">\n      <!-- 800 -->\n      <g transform=\"translate(338.514225 81.08028) scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-38\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(127.246094 0)\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_11\">\n     <g id=\"line2d_16\">\n      <g>\n       <use xlink:href=\"#ma612e5593a\" x=\"331.514225\" y=\"28.273326\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n      </g>\n     </g>\n     <g id=\"text_18\">\n      <!-- 1000 -->\n      <g transform=\"translate(338.514225 32.072545) scale(0.1 -0.1)\">\n       <defs>\n        <path id=\"DejaVuSans-31\" d=\"M 794 531 \nL 1825 531 \nL 1825 4091 \nL 703 3866 \nL 703 4441 \nL 1819 4666 \nL 2450 4666 \nL 2450 531 \nL 3481 531 \nL 3481 0 \nL 794 0 \nL 794 531 \nz\n\" transform=\"scale(0.015625)\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-31\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(63.623047 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(127.246094 0)\"/>\n       <use xlink:href=\"#DejaVuSans-30\" transform=\"translate(190.869141 0)\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"LineCollection_1\"/>\n   <g id=\"patch_8\">\n    <path d=\"M 318.208625 273.312 \nL 324.861425 273.312 \nL 331.514225 273.312 \nL 331.514225 7.2 \nL 324.861425 7.2 \nL 318.208625 7.2 \nL 318.208625 273.312 \nz\n\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"p1e6764b5e6\">\n   <rect x=\"34.240625\" y=\"7.2\" width=\"266.112\" height=\"266.112\"/>\n  </clipPath>\n </defs>\n</svg>\n"
     },
     "metadata": {}
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-8 fw=all -->\n",
    "\n",
    "The errors are anything but uniform: the model's worst failures are $4\\to9$, $5\\to3$, $8\\to3$, and $7\\to9$ (the reverse confusion $9\\to4$ sits just below the printed four). These are largely the digit pairs whose learned *templates*, plotted above, overlap the most: the most-overlapping pair is indeed the top confusion $4/9$, though the correspondence is loose rather than exact, as Exercise 6 lets you check. A $4$ and a $9$ differ mainly in whether the top strokes close into a loop, a fact carried by the *joint* behavior of a handful of neighboring pixels; a model that sees only per-pixel marginals is structurally blind to it. The confusion matrix is the independence assumption's failure map.\n",
    "\n",
    "Third, the confidence. The class scores determine a genuine posterior: since each score $s_y(\\mathbf x)$ is the logarithm of the Bayes-rule numerator $p(\\mathbf x\\mid y)\\,p(y)$, exponentiating and normalizing restores the dropped denominator, so $p(y\\mid\\mathbf x) = \\exp(s_y(\\mathbf x))/\\sum_{y'}\\exp(s_{y'}(\\mathbf x))$, a softmax of the scores (Exercise 4 works this out). The model therefore announces a probability along with each predicted digit. A model is **calibrated** if its announced probabilities match empirical\n",
    "frequencies: among predictions made with confidence $c$, a fraction $c$ should\n",
    "be correct. We predicted early in this section that multiplying $784$ falsely-independent factors would leave the model badly miscalibrated; the cell below checks, binning the test examples by their maximum posterior and comparing the claimed confidence with the achieved accuracy in each bin, the tabular form of a *reliability diagram*, the standard name for this diagnostic. (The softmax is evaluated in its subtract-the-max stable form from that section.)"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "id": "mdl-naive-bayes-calibration-3"
   },
   "source": [
    "s = scores(X_test)\n",
    "post = np.exp(s - s.max(axis=1, keepdims=True))        # softmax, stably\n",
    "post /= post.sum(axis=1, keepdims=True)\n",
    "conf_max = post.max(axis=1)                            # claimed confidence\n",
    "print(f'mean claimed confidence = {conf_max.mean():.3f},   '\n",
    "      f'actual accuracy = {correct.mean():.3f}')\n",
    "for a, b in zip([0.0, 0.9, 0.99, 0.999], [0.9, 0.99, 0.999, 1.0]):\n",
    "    m = (conf_max > a) & (conf_max <= b)\n",
    "    print(f'confidence in ({a}, {b}]: {m.sum():5d} examples,  '\n",
    "          f'claimed {conf_max[m].mean():.4f},  achieved {correct[m].mean():.4f}')"
   ],
   "execution_count": 8,
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "mean claimed confidence = 0.986,   actual accuracy = 0.843\nconfidence in (0.0, 0.9]:   447 examples,  claimed 0.7229,  achieved 0.3736\nconfidence in (0.9, 0.99]:   455 examples,  claimed 0.9606,  achieved 0.4747\nconfidence in (0.99, 0.999]:   406 examples,  claimed 0.9960,  achieved 0.5640\nconfidence in (0.999, 1.0]:  8692 examples,  claimed 1.0000,  achieved 0.8991\n"
     ]
    }
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-9 fw=all -->\n",
    "\n",
    "On average the model claims $98.6\\%$ confidence while delivering $84.3\\%$ accuracy, and the miscalibration is worst where the claims are strongest: $87\\%$ of all test examples land in the top bin, where the model asserts essentially $100\\%$ certainty yet is right only $89.9\\%$ of the time, and every other bin overstates itself too, with examples announced at $72\\%$ confidence being correct barely $37\\%$ of the time. (The *ordering* still carries signal, since accuracy does rise with confidence bin, but the probabilities themselves are grossly inflated.) This is exactly what the log-space picture predicts. Each of the $784$ pixels contributes its log-likelihood ratio to the score *as if* it were independent evidence, so correlated pixels get counted many times over and the score gaps between classes grow far beyond what the evidence supports: the median gap between the best and second-best class score on the test set is about $30$ nats (natural-log units; that section makes the unit precise), and since $e^{-30}\\approx 10^{-13}$ that already pushes the softmax to $0$ or $1$; gaps of hundreds of nats occur only between the best and *worst* classes. The same failure extends well past naive Bayes: modern neural classifiers trained to low loss are overconfident in the same direction, though to a smaller degree [@Guo.Pleiss.Sun.Weinberger.2017], which is why the reliability check you just ran, confidence binned against accuracy, is a standard diagnostic for any classifier whose probabilities you intend to consume.\n",
    "\n",
    "## Summary\n",
    "\n",
    "* Bayes' rule recasts classification generatively: $p(y\\mid\\mathbf{x}) \\propto p(\\mathbf{x}\\mid y)\\,p(y)$, predicting the label that maximizes the numerator.\n",
    "* As a **generative** model it estimates $p(\\mathbf{x}\\mid y)\\,p(y)$, the mirror image of a **discriminative** model like softmax regression, which estimates $p(y\\mid\\mathbf{x})$ directly. Sample-efficiency and asymptotic-error comparisons depend on the model families and which assumptions match the data.\n",
    "* The **naive** conditional-independence assumption $p(\\mathbf{x}\\mid y)=\\prod_i p(x_i\\mid y)$ replaces $\\mathcal{O}(2^d)$ parameters with $\\mathcal{O}(d)$, and the classifier needs only the $\\mathrm{argmax}$, not the probabilities, to be right.\n",
    "* Working in log space avoids the underflow of multiplying hundreds of probabilities. Bernoulli and multinomial naive Bayes have scores affine in their chosen features and therefore linear decision boundaries; Gaussian naive Bayes with class-dependent variances generally has quadratic boundaries.\n",
    "* Training is maximum likelihood by counting: class priors and per-feature frequencies. Laplace smoothing, $(n_{iy}+1)/(n_y+2)$ for a binary feature, is the posterior mean under a uniform prior (that section) and keeps every log-probability finite.\n",
    "* On MNIST it learns ten averaged digit templates and classifies respectably, but its independence assumption caps accuracy. It shines where features are closer to independent, the canonical case being bag-of-words text classification.\n",
    "* The $84.27\\%$ carries a bootstrap error bar of about $\\pm 0.7$ points; the confusion matrix localizes the failures in template-overlapping pairs like $4/9$ and $5/3$; and the model is severely **miscalibrated**, claiming $98.6\\%$ mean confidence while delivering $84.3\\%$ accuracy, because falsely independent factors double-count correlated evidence. Bin confidence against accuracy (a reliability diagram) before trusting any classifier's probabilities.\n",
    "\n",
    "## Exercises\n",
    "1. Consider the dataset $\\{(0,0),(0,1),(1,0),(1,1)\\}$ with labels given by the XOR of the two coordinates, $\\{0,1,1,0\\}$. Compute the naive Bayes estimates $p(y)$ and $p(x_i\\mid y)$. Does the classifier separate the points? If not, which assumption is violated?\n",
    "2. Suppose we omitted Laplace smoothing and, at test time, an example contained a feature value never observed for some class in training. What would the model's log-score for that class be, and why?\n",
    "3. The naive Bayes classifier is a special case of a Bayesian network, in which dependencies among random variables are encoded by a graph (see @Koller.Friedman.2009). Explain why adding an explicit edge between the two inputs of the XOR model would let it classify the points correctly.\n",
    "4. The discussion after the equation showed that each class score of the binary model is affine, $s_y(\\mathbf{x}) = \\mathbf{w}_y\\cdot\\mathbf{x} + b_y$. Derive the exact posterior by normalizing: show that $p(y\\mid\\mathbf{x}) = \\exp(s_y(\\mathbf{x}))\\,/\\sum_{y'} \\exp(s_{y'}(\\mathbf{x}))$, and recognize the softmax. Conclude that naive Bayes produces posteriors of exactly the functional form that softmax regression (that section) fits directly; the two classifiers differ only in how the weights $\\mathbf{w}_y, b_y$ are set. (With two classes, you recover logistic regression.)\n",
    "5. Generalize the smoothing in the training cell to a pseudocount $\\alpha$, estimating $p(x_i{=}1\\mid y)$ as $(n_{iy}+\\alpha)/(n_y+2\\alpha)$, and report the MNIST test accuracy for $\\alpha\\in\\{0,1,10\\}$. Explain what you observe at $\\alpha=0$: beyond the $-\\infty$ log-probabilities of exercise 2, what does the scoring code compute when a pixel with $\\hat p(x_i{=}1\\mid y)=0$ is *off* in a test image? (Recall that $0\\cdot(-\\infty)$ is NaN in floating point.)\n",
    "6. Check the template-overlap explanation of the confusion matrix: flatten the ten smoothed templates in $P_{xy}$ into vectors and compute the cosine similarity of every pair (one line with NumPy). Which pairs overlap most, and how well do they match the top confusions? You should find that $(4,9)$ is the most similar pair, at cosine similarity about $0.92$, matching the top confusion, but that the second most similar pair, $(5,8)$ at about $0.91$, is *not* among the top four confusions: the correspondence between template overlap and confusion is real but loose."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!-- d2l:prose id=mdl-naive-bayes-md-10 fw=jax -->\n",
    "\n",
    "[Discussions](https://d2l.discourse.group/t/1101)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "name": "d2l-jax",
   "display_name": "d2l (JAX)",
   "language": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
