TP_classification.ipynb 122 KB
Newer Older
1 2 3 4 5 6 7 8
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# TP Apprentissage supervisé: Classification / Discrimination\n",
    "\n",
9
    "Dans ce tp, on fait de la Classification / Discrimination, c'est-à-dire que l'on connaît les \"vrais\" labels de nos classes. \n",
10 11 12
    "\n",
    "On va utiliser les données Breast cancer dataset (classification).\n",
    "\n",
13
    "Une description de ces données est disponible à l'adresse https://scikit-learn.org/stable/datasets/index.html#breast-cancer-wisconsin-diagnostic-dataset. Jetez un coup d'oeil pour comprendre la problématique.\n",
14
    "\n",
15
    "Importez les libraries de ce matin: `numpy` et `scikit datasets`."
16 17 18 19
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
20
   "execution_count": 1,
21 22
   "metadata": {},
   "outputs": [],
TheophilePACE's avatar
TheophilePACE committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
   "source": [
    "import numpy as np\n",
    "from sklearn import datasets\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "breast_cancer = datasets.load_breast_cancer()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = breast_cancer.data\n",
    "y = breast_cancer.target\n",
    "feature_names = breast_cancer.feature_names"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(569, 30) (569,)\n",
      "[0 0 0 0 0]\n",
      "['mean radius' 'mean texture' 'mean perimeter' 'mean area'\n",
      " 'mean smoothness' 'mean compactness' 'mean concavity'\n",
      " 'mean concave points' 'mean symmetry' 'mean fractal dimension'\n",
      " 'radius error' 'texture error' 'perimeter error' 'area error'\n",
      " 'smoothness error' 'compactness error' 'concavity error'\n",
      " 'concave points error' 'symmetry error' 'fractal dimension error'\n",
      " 'worst radius' 'worst texture' 'worst perimeter' 'worst area'\n",
      " 'worst smoothness' 'worst compactness' 'worst concavity'\n",
      " 'worst concave points' 'worst symmetry' 'worst fractal dimension']\n"
     ]
    }
   ],
   "source": [
    "print(X.shape, y.shape)\n",
    "print(y[:5])\n",
    "print(feature_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2.057e+01, 1.777e+01, 1.329e+02, 1.326e+03, 8.474e-02])"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[1][:5]"
   ]
97 98 99 100 101
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
102
    "Chargez les données depuis `datasets.load_boston`. Que renvoie cette fonction ? Chargez vos données dans des variables appelées X et y pour avoir, respectivement, les données et les labels."
103 104 105 106 107 108 109
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Formatage du jeu de données\n",
110
    "Pour entraîner nos algorithmes, on va splitter notre jeu de données en 3 sous-jeux de données: \n",
111 112 113 114 115 116
    "- train\n",
    "- validation\n",
    "- test\n",
    "\n",
    "Pourquoi est-ce nécessaire?\n",
    "\n",
TheophilePACE's avatar
TheophilePACE committed
117 118 119
    "Pour cela, utilisez la fonction scikit-learn `sklearn.model_selection.train_test_split`. Importez cette méthode, appliquer là à nos données.\n",
    "\n",
    "On utilise 2 fois train_test_split, afin de séparer 2 fois l'ensemble: une fois entre train_validation d'une part, unee fois entre train et validation."
120 121 122 123
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
124
   "execution_count": 6,
125 126
   "metadata": {},
   "outputs": [],
TheophilePACE's avatar
TheophilePACE committed
127 128 129 130 131 132 133 134 135 136 137 138 139
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_tv,X_test, y_tv,y_test = train_test_split(X,y,test_size=.2, random_state=42)\n",
    "X_train,X_validation,y_train,y_validation = train_test_split(X_tv,y_tv,test_size=.25,random_state=42)"
   ]
140 141 142 143 144 145
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# K-NNs\n",
146
    "On va lancer les k-nns sur ce dataset. Essayez `K = 1`, puis `K = n` (n est le nombre de samples). Observez dans $R^2$. Commentez."
147 148 149 150
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
151
   "execution_count": 8,
152 153
   "metadata": {},
   "outputs": [],
TheophilePACE's avatar
TheophilePACE committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
   "source": [
    "from sklearn.neighbors import KNeighborsClassifier \n",
    "from sklearn.metrics import confusion_matrix, accuracy_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 0.9298245614035088\n",
      "[[40  4]\n",
      " [ 4 66]]\n",
      "4 0.9210526315789473\n",
      "[[40  4]\n",
      " [ 5 65]]\n",
      "7 0.9385964912280702\n",
      "[[40  4]\n",
      " [ 3 67]]\n",
      "10 0.9385964912280702\n",
      "[[40  4]\n",
      " [ 3 67]]\n",
      "13 0.9298245614035088\n",
      "[[39  5]\n",
      " [ 3 67]]\n",
      "16 0.9210526315789473\n",
      "[[39  5]\n",
      " [ 4 66]]\n",
      "19 0.9298245614035088\n",
      "[[39  5]\n",
      " [ 3 67]]\n"
     ]
    }
   ],
   "source": [
    "# hyperparamter\n",
    "K_max = 20\n",
    "for K in range(1,K_max,3):\n",
    "    # declare classifier with hyperparameters\n",
    "    knn = KNeighborsClassifier(n_neighbors=K)\n",
    "    # train (aka fit) the classifier on the train dataset\n",
    "    knn.fit(X_train,y_train)\n",
    "    # predict the validation dataset\n",
    "    y_validation_hat = knn.predict(X_validation)\n",
    "    # check the result\n",
    "    print(K,accuracy_score(y_pred=y_validation_hat,y_true=y_validation))\n",
    "    print(confusion_matrix(y_pred=y_validation_hat,y_true=y_validation))\n",
    "    # Now, adjust hyperparamaeters"
   ]
207 208 209 210 211
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
212 213 214
    "Comment choisir K? Essayez différents K, regardez les résultats.\n",
    "\n",
    "Notre objectif est de minimiseer le taux d'erreur. On va tracer 1 - accuracy en fonction de K, et choisir le K le plus faibble:"
215 216 217 218
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
219
   "execution_count": 10,
220
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
221 222 223 224
   "outputs": [
    {
     "data": {
      "text/plain": [
TheophilePACE's avatar
TheophilePACE committed
225
       "[<matplotlib.lines.Line2D at 0x106acd860>]"
TheophilePACE's avatar
TheophilePACE committed
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8XNV99/HPTzPSyNbIRpvFYsuWQTY4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r7m7HwP+nVM4zmFI+suBuuCMfBGJEzCLsxzTAGZWYmalvcvAdcCrJGLtvaPY7cAT2YnwhIaKcTHw0WAEwaXAgd6uiWzr16/5uySONSRinh+M1KglMTHgS1mIz4B/A15z92+kbBqXx3qoeMfzcTazKkvM9ouZTQDeS+JcxFLg1qBa/2Pce+xvBZ714GzpWBki5tdTGgJG4hxE6nHO7HMx1menR+NB4gx2E4n+ui9kO54hYpxJYjTDamBtb5wk+gx/AawP/i3Pcpw/IPEzvZNEK+KOoWIk8dNyYXDcXwHqx1HMjwYxrQn+Y5yRUv8LQcyNwA1ZivlyEj/D1wCrgseN4/VYnyDecXucgbeRmPxxTZAk7wvKZ5L4AtoA/BCIBeXFwfqGYPvMcRTzs8FxfhX4fxwf4ZPx50JX5IqI5JEwdO+IiEialPRFRPKIkr6ISB5R0hcRySNK+iIieURJX0Qkjyjpi4jkESV9EZE88v8B1Sg3Y6MqafQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# hyperparamter\n",
    "K_max = len(X_train)\n",
    "accuracies = []\n",
    "for K in range(1,K_max,1):\n",
    "    # declare classifier with hyperparameters\n",
    "    knn = KNeighborsClassifier(n_neighbors=K)\n",
    "    # train (aka fit) the classifier on the train dataset\n",
    "    knn.fit(X_train,y_train)\n",
    "    # predict the validation dataset\n",
    "    y_validation_hat = knn.predict(X_validation)\n",
    "    # check the result\n",
    "    accuracies.append(accuracy_score(y_pred=y_validation_hat,y_true=y_validation))\n",
    "# si on trace juste le tableau, on sera décalé de 1\n",
    "plt.plot(range(1,K_max),accuracies)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
TheophilePACE's avatar
TheophilePACE committed
268
       "[<matplotlib.lines.Line2D at 0x106a30860>]"
TheophilePACE's avatar
TheophilePACE committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztnX20JHdZ579Pv1T17Zc7k7m3O4bMkASZFQaNYRkCgpgQWQ3iJkBYDCKgx7M5euAcPYqarMqezSGHxc0Kuyt6ZBUBwcWQFcyRCMvGRFnByMS8E5IMgZDJhHTfO5m53fdOV789+0fVr7pu3aquX3VXvz+fc+ZMd3VV9a/6Vv2e3/NOzAxBEARBSE17AIIgCMJsIAJBEARBACACQRAEQXAQgSAIgiAAEIEgCIIgOIhAEARBEACIQBAEQRAcRCAIgiAIAEQgCIIgCA6ZaQ8gDuvr63zhhRdOexiCIAhzxT333LPBzOWo/eZKIFx44YU4duzYtIchCIIwVxDRkzr7iclIEARBACACQRAEQXAQgSAIgiAAEIEgCIIgOIhAEARBEACIQBAEQRAcRCAIgiAIAOYsD2GSfPGh7+FlF5yDcskc+Vx/9S8n8J2N7VjHrK5k8QuvvgjpFGntf7xaR7Vu4VXfvz7MEAUhcf7piU189fhGrGOy6RR+9hXPx1px9OdOiI8IhACa7S5++dP34L0/8QN492tfOPK5fu2W+wEApDe3Q7W5vvSiA7j44H6tYz705cdx73efw1dv+PFhhikIifP+L3wDDz29Ffu+318w8I5XXjC+gQmhiEAIwGr3wAxsNdsjn6u6ZQEAfu8tF+OtRw9pHfPAidO46g/+Ec86x+rwva0mqnULvR4jpalVCMI4+d4ZC9e+/BD+8zUXa+3fbHfxot/9IuoJPHfCcIgPIQCr0wUA7Fj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BXEVE34FtGr4CtsawFNfPzCed/6uwFwOXIsH7flEEwtcBHHYiDQwA1wK4bcpjmga3AXiX8/pdAP56imMZG47N+E8BPMLMv+/5aOGvn4jKjmYAIloB8DrYPpQ7AbzF2W0hrx0AmPkGZj7IzBfCfs7/jpnfjiW4fiIqEFFJvQbwEwAeQoL3/cIkphHRT8FeKaQBfIyZb5rykMYKEf0vAJfDrnT4LID/CODzAG4B8HwA3wXw75jZ73iee4joRwF8BcCD6NuR/wNsP8JCXz8RXQzbcZiGvaC7hZlvJKIXwF4xHwBwL4CfY2ZreiMdP47J6L3M/NPLcP3ONX7OeZsB8BfMfBMRrSGh+35hBIIgCIIwGotiMhIEQRBGRASCIAiCAEAEgiAIguAgAkEQBEEAIAJBEARBcBCBIAiCIAAQgSAIgiA4iEAQBEEQAAD/HwQJ451KUKvDAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(range(1,50),accuracies[:49])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0.9385964912280702, 3)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# On cherche le k ayant la precision maximale: argument du maximum, + 1 car les index sont décalés de 1\n",
    "np.max(accuracies),np.argmax(accuracies)+1"
   ]
310 311 312 313 314
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
315 316
    "# Algorithme Bayésien naif (NBC)\n",
    "\n",
317
    "On va maintenant utiliser l'agorithme bayésien naif (*naive baeysian classifier* pour les gens hype). Pour rappel, le modèle se base sur l'indépendance des _features_ et l'hypothèse gaussienne. Les amoureux de SY01 se souviendront de la formule de bayes: \n",
318 319 320
    "$$\n",
    "P(X | Y) = \\frac{P(Y|X) \\times P(X)}{P(Y)}\n",
    "$$\n",
321
    "Bref, commencez par importer le NBC depuis scikit-learn. https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html"
322 323
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
324 325 326 327 328 329 330 331
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
TheophilePACE's avatar
TheophilePACE committed
332
       "\u001b[0;31mInit signature:\u001b[0m \u001b[0mGaussianNB\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpriors\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvar_smoothing\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1e-09\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
TheophilePACE's avatar
TheophilePACE committed
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413
       "\u001b[0;31mDocstring:\u001b[0m     \n",
       "Gaussian Naive Bayes (GaussianNB)\n",
       "\n",
       "Can perform online updates to model parameters via `partial_fit` method.\n",
       "For details on algorithm used to update feature means and variance online,\n",
       "see Stanford CS tech report STAN-CS-79-773 by Chan, Golub, and LeVeque:\n",
       "\n",
       "    http://i.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf\n",
       "\n",
       "Read more in the :ref:`User Guide <gaussian_naive_bayes>`.\n",
       "\n",
       "Parameters\n",
       "----------\n",
       "priors : array-like, shape (n_classes,)\n",
       "    Prior probabilities of the classes. If specified the priors are not\n",
       "    adjusted according to the data.\n",
       "\n",
       "var_smoothing : float, optional (default=1e-9)\n",
       "    Portion of the largest variance of all features that is added to\n",
       "    variances for calculation stability.\n",
       "\n",
       "Attributes\n",
       "----------\n",
       "class_prior_ : array, shape (n_classes,)\n",
       "    probability of each class.\n",
       "\n",
       "class_count_ : array, shape (n_classes,)\n",
       "    number of training samples observed in each class.\n",
       "\n",
       "theta_ : array, shape (n_classes, n_features)\n",
       "    mean of each feature per class\n",
       "\n",
       "sigma_ : array, shape (n_classes, n_features)\n",
       "    variance of each feature per class\n",
       "\n",
       "epsilon_ : float\n",
       "    absolute additive value to variances\n",
       "\n",
       "Examples\n",
       "--------\n",
       ">>> import numpy as np\n",
       ">>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])\n",
       ">>> Y = np.array([1, 1, 1, 2, 2, 2])\n",
       ">>> from sklearn.naive_bayes import GaussianNB\n",
       ">>> clf = GaussianNB()\n",
       ">>> clf.fit(X, Y)\n",
       "GaussianNB(priors=None, var_smoothing=1e-09)\n",
       ">>> print(clf.predict([[-0.8, -1]]))\n",
       "[1]\n",
       ">>> clf_pf = GaussianNB()\n",
       ">>> clf_pf.partial_fit(X, Y, np.unique(Y))\n",
       "GaussianNB(priors=None, var_smoothing=1e-09)\n",
       ">>> print(clf_pf.predict([[-0.8, -1]]))\n",
       "[1]\n",
       "\u001b[0;31mFile:\u001b[0m           ~/miniconda3/lib/python3.6/site-packages/sklearn/naive_bayes.py\n",
       "\u001b[0;31mType:\u001b[0m           ABCMeta\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.naive_bayes import GaussianNB\n",
    "# no hyperparamter\n",
    "nbc = GaussianNB?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "nbc = GaussianNB"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431
   "outputs": [],
   "source": [
    "nbc = GaussianNB"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "nbc = GaussianNB"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[40  4]\n",
      " [ 5 65]]\n",
      "0.9210526315789473\n"
     ]
    }
   ],
   "source": [
    "clf = GaussianNB()\n",
    "clf.fit(X=X_train,y=y_train)\n",
    "y_validation_hat = clf.predict(X_validation)\n",
    "print(confusion_matrix(y_pred=y_validation_hat, y_true=y_validation))\n",
    "print(accuracy_score(y_pred=y_validation_hat, y_true=y_validation))"
   ]
  },
451 452 453 454
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
455 456 457 458 459 460 461 462 463 464 465 466
    "__On compare toujours les modèles sur l'ensemble de test!__\n",
    "Pour chaque modèle\n",
    "- On entraine sur X_train\n",
    "- On prédit X_validation, on ajuste ses paramètres\n",
    "- on réentraine sur X_train\n",
    "- On prédit X_validation, et ainsi de suite tant que le résultat n'est pas satisfaisant\n",
    "- __Finalement, une seule fois__, on lance sur X_test. \n",
    "- On compare avec les autres modèle"
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
467
   "execution_count": 17,
TheophilePACE's avatar
TheophilePACE committed
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "K-NN With k= 6\n",
      "0.956140350877193\n",
      "[[42  1]\n",
      " [ 4 67]]\n",
      "NBC\n",
      "0.9649122807017544\n",
      "[[40  3]\n",
      " [ 1 70]]\n"
     ]
    }
   ],
   "source": [
    "# COMPARAISON DES MODELES\n",
    "# K-NN\n",
    "# declare classifier with hyperparameters\n",
    "knn = KNeighborsClassifier(n_neighbors=6)\n",
    "# train (aka fit) the classifier on the train dataset\n",
    "knn.fit(X_train,y_train)\n",
    "# predict the validation dataset\n",
    "y_test_hat_knn = knn.predict(X_test)\n",
    "# check the result\n",
    "print(\"K-NN With k= 6\")\n",
    "print(accuracy_score(y_pred=y_test_hat_knn,y_true=y_test))\n",
    "print(confusion_matrix(y_pred=y_test_hat_knn,y_true=y_test))\n",
    "\n",
    "# NBC\n",
    "y_test_hat_nbc = clf.predict(X_test)\n",
    "print(\"NBC\")\n",
    "print(accuracy_score(y_pred=y_test_hat_nbc,y_true=y_test))\n",
    "print(confusion_matrix(y_pred=y_test_hat_nbc,y_true=y_test))"
504 505 506 507 508 509
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
510
    "**Optionel** Quels sont vos résultats? Essayez d'afficher vos clusters en 2D dans $R^2$. Vous pouvez appliquer une PCA et garder 2 composantes. De là, c'est possible de plot dans $R^2$."
511 512 513 514 515 516
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
517 518 519 520
    "# Régression logistique\n",
    "\n",
    "On va utiliser la régression logistique (aka *logistic regression*). Rappel de ce modèle, pour deux classes: \n",
    "\n",
521 522 523
    "$$Pr(C_0 | features) + Pr(C_1 | features) = 1$$\n",
    "$$Pr(C_1 | features) = \\frac{1}{1+\\exp^{w_O +w_1\\times features}}$$\n",
    "\n",
524 525 526 527
    "Avec $C_0$ et $C_1$ les deux classes à discriminer. On veut donc déterminer les poids $w = (w_0,w_1)$.\n",
    "\n",
    "Et, de manière assez inattendue... Scikit propose un implémentation de la régression logistique. La doc est consultable ici: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html\n",
    "\n",
TheophilePACE's avatar
TheophilePACE committed
528 529 530 531 532
    "Appliquez la régression logistique toujours sur les données `breast_cancer`."
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
533
   "execution_count": 18,
TheophilePACE's avatar
TheophilePACE committed
534 535 536 537 538 539 540 541
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression"
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
542
   "execution_count": 19,
TheophilePACE's avatar
TheophilePACE committed
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9649122807017544\n",
      "[[42  2]\n",
      " [ 2 68]]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/theophilepace/miniconda3/lib/python3.6/site-packages/sklearn/linear_model/logistic.py:433: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "logreg = LogisticRegression()\n",
    "logreg.fit(X_train,y_train)\n",
    "y_hat = logreg.predict(X_validation)\n",
    "print(accuracy_score(y_pred=y_hat,y_true=y_validation))\n",
    "print(confusion_matrix(y_pred=y_hat,y_true=y_validation))"
569 570 571 572 573 574
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
575
    "Quels sont vos résultats (calculer l'accuracy) ? Sont-ils meilleurs que pour le NBC?"
576 577
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
578 579
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
580
   "execution_count": 20,
TheophilePACE's avatar
TheophilePACE committed
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.956140350877193\n",
      "[[39  4]\n",
      " [ 1 70]]\n"
     ]
    }
   ],
   "source": [
    "pred= logreg.predict(X_test)\n",
    "print(accuracy_score(y_pred=pred,y_true=y_test))\n",
    "print(confusion_matrix(y_pred=pred,y_true=y_test))"
   ]
  },
599 600 601 602
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
603
    "Le principal avantage de la régression logistique est son interprétabilité, grâce aux poids. Quelles sont les features qui vous ont permis de discriminer entre les classes? Regardez et comparer pour cela les poids du vecteur $w$."
604 605
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
606 607
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
608
   "execution_count": 21,
TheophilePACE's avatar
TheophilePACE committed
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 2.16929585e+00,  1.03505165e-01, -1.69351567e-01,\n",
       "        -4.09229286e-04, -1.26894192e-01, -4.17556456e-01,\n",
       "        -6.57815732e-01, -3.19770431e-01, -1.87089660e-01,\n",
       "        -2.83143858e-02, -1.98836785e-02,  1.43346281e+00,\n",
       "        -2.24578570e-01, -6.55814280e-02, -1.53238693e-02,\n",
       "        -2.51797663e-02, -7.41128784e-02, -3.60638850e-02,\n",
       "        -4.08750126e-02,  1.59879611e-03,  1.23695888e+00,\n",
       "        -3.83174555e-01, -1.67220956e-02, -2.81166697e-02,\n",
       "        -2.40073214e-01, -1.25834089e+00, -1.67423372e+00,\n",
       "        -5.79028509e-01, -6.93277983e-01, -1.24763925e-01]])"
      ]
     },
TheophilePACE's avatar
TheophilePACE committed
626
     "execution_count": 21,
TheophilePACE's avatar
TheophilePACE committed
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "logreg.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
642 643 644 645
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
646
    "**optionel** Essayez de tracer vos classes dans $R^2$, en utilisant les 2 features les plus discriminantes."
647 648
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
649 650 651 652 653 654 655
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
656 657 658 659
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
660 661 662 663 664 665
    "# Support Vector Machine (SVM)\n",
    "\n",
    "Machine à vecteur de Support (Système à Vaste Marge pour les littéraires), les SVMs sont des algorithmes plus complexes. \n",
    "\n",
    "Ils perdent l'interprétabilité de la *logistic regression*, mais permettent d'obtenir des frontières de décision non linéaires grâce au kernel trick. Très puissants, ils ont été les algorithmes phares des années 90 et début 2000.\n",
    "\n",
666
    "Le modèle est assez complexe, basé sur l'estimation de la marge. Voici pour rappel un schéma volé sur Wikipédia, qui présente le cas facilement séparable:\n",
667 668 669 670 671 672 673 674 675 676 677
    "\n",
    "<img src=\"https://upload.wikimedia.org/wikipedia/commons/7/72/SVM_margin.png\" width=\"400\" height=\"400\" />\n",
    "\n",
    "La puissance des SVM est basée sur la notion de kernel explorée en détail ce matin. On utilisera le noyau gaussien, appelé `rbf` dans scikit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Utilisation"
678 679 680 681 682 683 684
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Étonnement, nous utiliserons l'implémentation scikit-learn. La doc est ici : https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html\n",
685
    "Importez cette méthode. Consulter la doc string ou la documentation intégrée. Quels sont les paramètres?"
686 687 688 689 690 691
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
692
    "Lancez un SVM sur nos données, avec un noyeau linéaire `kernel='linear'`. "
693 694
   ]
  },
695 696
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
697
   "execution_count": 22,
698
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.956140350877193\n",
      "[[42  2]\n",
      " [ 3 67]]\n"
     ]
    }
   ],
   "source": [
    "from sklearn.svm import SVC\n",
    "svm = SVC(kernel='linear')\n",
    "svm.fit(X_train,y_train)\n",
    "y_hat = svm.predict(X_validation)\n",
    "print(accuracy_score(y_pred=y_hat,y_true=y_validation))\n",
    "print(confusion_matrix(y_pred=y_hat,y_true=y_validation))"
   ]
718
  },
719 720 721 722 723 724 725 726 727 728 729 730 731 732
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cela revient en fait à appliquer un classifieur linéaire sur le jeu de données. Quels sont vos résultats? Sont-ils très différents de ceux obtenus avec la regression logisitique ?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "On va maintenant utiliser un noyeau non linéaire, le `rbf`. Réutilisez votre code précédent, en changeant simplement le kernel."
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
733 734
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
735
   "execution_count": 23,
TheophilePACE's avatar
TheophilePACE committed
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9298245614035088\n",
      "[[39  5]\n",
      " [ 3 67]]\n"
     ]
    }
   ],
   "source": [
    "svm = SVC(kernel='rbf', gamma='scale')\n",
    "svm.fit(X_train,y_train)\n",
    "y_hat = svm.predict(X_validation)\n",
    "print(accuracy_score(y_pred=y_hat,y_true=y_validation))\n",
    "print(confusion_matrix(y_pred=y_hat,y_true=y_validation))"
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
758
   "execution_count": 24,
TheophilePACE's avatar
TheophilePACE committed
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.956140350877193\n",
      "[[39  4]\n",
      " [ 1 70]]\n"
     ]
    }
   ],
   "source": [
    "y_pred = svm.predict(X_test)\n",
    "print(accuracy_score(y_pred=pred,y_true=y_test))\n",
    "print(confusion_matrix(y_pred=pred,y_true=y_test))"
   ]
  },
777 778 779 780
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
781
    "## Performances / complexité"
782 783 784 785 786 787
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
788 789 790 791 792 793 794
    "C'est fini? Pas encore? Toujours pas? La méthode est bien plus complexe que la régression logistique. \n",
    "Plus complexe --> plus de calculs --> plus lent.\n",
    "Quels sont vos résultats (calculer l'accuracy ici)? Sont-ils meilleurs que précédemment?"
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
795
   "execution_count": 25,
796
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
797 798 799 800 801
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
TheophilePACE's avatar
TheophilePACE committed
802 803
      "183 µs ± 4.71 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n",
      "776 µs ± 6.52 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
TheophilePACE's avatar
TheophilePACE committed
804 805 806 807 808 809 810
     ]
    }
   ],
   "source": [
    "%timeit clf.predict(X_train)\n",
    "%timeit svm.predict(X_test)"
   ]
811 812 813 814 815 816
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "En fait, il n'y a pas que le kernel qui paramètrise votre SVM. Le paramètre de régularisation est aussi à fixer. Pour l'instant quel est votre paramètre C? Regardez dans la doc (il y a une valeur par défaut).\n",
817 818 819 820
    "\n",
    "Essayez `C=20`. Commentez vos résultats."
   ]
  },
821 822 823 824 825 826 827
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
828 829 830 831
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
832
    "Cherchez \"à la main\" un `C` optimal. Nous verrons plus tard comment faire cela automatiquement."
833 834 835 836 837 838
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
839
    "**optionel** Vous souvenez-vous de la commande magic permettant de connaitre le temps de calcul d'une cellule ? `%timeit`\n",
840
    "Comparez le temps pris par la régression logistique et le SVM."
841 842 843 844 845 846
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
847
    "# Arbres de décision\n",
848 849
    "Les arbres de décision sont une méthode extrêmement puissante, surtout quand ils sont utilisés avec des méthodes de boosting (que nous verrons peut-être aussi aujourd'hui). De plus, les arbres sont très interprétables. C'est à dire qu'on peut comprendre facilement comment une prédiction à été faite, en suivant dans l'arbre le chemin à travers les noeuds.\n",
    "\n",
850
    "![](https://upload.wikimedia.org/wikipedia/commons/2/25/Cart_tree_kyphosis.png)\n",
851 852 853 854
    "\n",
    "On va utiliser cette méthode pour faire de la classification. Cherchez l'implémentation scikit de cette méthode. En anglais, on parle de *decision tree classifier*.  https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html#sklearn.tree.DecisionTreeClassifier\n",
    "\n",
    "Consulter la doc string."
855 856
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
857 858
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
859
   "execution_count": 33,
TheophilePACE's avatar
TheophilePACE committed
860
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
861
   "outputs": [],
TheophilePACE's avatar
TheophilePACE committed
862 863
   "source": [
    "from sklearn.tree import DecisionTreeClassifier\n",
TheophilePACE's avatar
TheophilePACE committed
864 865 866
    "# pour les utilisateurs d'os normaux:\n",
    "! conda install graphviz python-graphviz\n",
    "# raise NotImplementedError(\"INSTALLEZ GRAPHVIZ\")\n",
TheophilePACE's avatar
TheophilePACE committed
867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
    "# ne vous occupez pas de cette fonction, c'est juste de la visu\n",
    "\n",
    "from graphviz import Source\n",
    "from sklearn.tree import export_graphviz\n",
    "from IPython.display import SVG\n",
    "\n",
    "\n",
    "def visualize_tree(clf):\n",
    "    dotefile_string = export_graphviz(clf, out_file=None,feature_names=feature_names, class_names=breast_cancer.target_names)\n",
    "    graph = Source(dotefile_string)\n",
    "    return SVG(graph.pipe('svg'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Lancez un arbre avec `DecisionTreeClassifier`. Essayez sur votre ensemble de validation."
   ]
  },
887 888
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
889
   "execution_count": 40,
890
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg height=\"790pt\" viewBox=\"0.00 0.00 950.00 790.00\" width=\"950pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 786)\">\n",
       "<title>Tree</title>\n",
       "<polygon fill=\"#ffffff\" points=\"-4,4 -4,-786 946,-786 946,4 -4,4\" stroke=\"transparent\"/>\n",
       "<!-- 0 -->\n",
       "<g class=\"node\" id=\"node1\">\n",
       "<title>0</title>\n",
       "<polygon fill=\"none\" points=\"584,-782 395,-782 395,-699 584,-699 584,-782\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"489.5\" y=\"-766.8\">worst concave points &lt;= 0.142</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"489.5\" y=\"-751.8\">gini = 0.464</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"489.5\" y=\"-736.8\">samples = 341</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"489.5\" y=\"-721.8\">value = [125, 216]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"489.5\" y=\"-706.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 1 -->\n",
       "<g class=\"node\" id=\"node2\">\n",
       "<title>1</title>\n",
       "<polygon fill=\"none\" points=\"471,-663 342,-663 342,-580 471,-580 471,-663\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-647.8\">worst area &lt;= 929.8</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-632.8\">gini = 0.17</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-617.8\">samples = 234</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-602.8\">value = [22, 212]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-587.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;1 -->\n",
       "<g class=\"edge\" id=\"edge1\">\n",
       "<title>0-&gt;1</title>\n",
       "<path d=\"M460.4706,-698.8796C454.3145,-690.0534 447.7549,-680.6485 441.4064,-671.5466\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"444.2448,-669.4978 435.6533,-663.2981 438.5033,-673.5024 444.2448,-669.4978\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"431.2669\" y=\"-684.2103\">True</text>\n",
       "</g>\n",
       "<!-- 16 -->\n",
       "<g class=\"node\" id=\"node17\">\n",
       "<title>16</title>\n",
       "<polygon fill=\"none\" points=\"623,-663 494,-663 494,-580 623,-580 623,-663\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-647.8\">worst area &lt;= 444.3</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-632.8\">gini = 0.072</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-617.8\">samples = 107</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-602.8\">value = [103, 4]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-587.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;16 -->\n",
       "<g class=\"edge\" id=\"edge16\">\n",
       "<title>0-&gt;16</title>\n",
       "<path d=\"M513.6329,-698.8796C518.6461,-690.2335 523.9813,-681.0322 529.1581,-672.1042\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"532.2758,-673.7047 534.2641,-663.2981 526.2202,-670.1934 532.2758,-673.7047\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.6897\" y=\"-683.7582\">False</text>\n",
       "</g>\n",
       "<!-- 2 -->\n",
       "<g class=\"node\" id=\"node3\">\n",
       "<title>2</title>\n",
       "<polygon fill=\"none\" points=\"306,-544 149,-544 149,-461 306,-461 306,-544\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-528.8\">symmetry error &lt;= 0.009</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-513.8\">gini = 0.054</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-498.8\">samples = 215</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-483.8\">value = [6, 209]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-468.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;2 -->\n",
       "<g class=\"edge\" id=\"edge2\">\n",
       "<title>1-&gt;2</title>\n",
       "<path d=\"M343.8945,-579.8796C329.3146,-570.1868 313.6849,-559.7961 298.7618,-549.8752\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"300.3355,-546.7185 290.0702,-544.0969 296.4601,-552.5479 300.3355,-546.7185\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 11 -->\n",
       "<g class=\"node\" id=\"node12\">\n",
       "<title>11</title>\n",
       "<polygon fill=\"none\" points=\"478.5,-544 334.5,-544 334.5,-461 478.5,-461 478.5,-544\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-528.8\">worst texture &lt;= 19.33</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-513.8\">gini = 0.266</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-498.8\">samples = 19</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-483.8\">value = [16, 3]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"406.5\" y=\"-468.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;11 -->\n",
       "<g class=\"edge\" id=\"edge11\">\n",
       "<title>1-&gt;11</title>\n",
       "<path d=\"M406.5,-579.8796C406.5,-571.6838 406.5,-562.9891 406.5,-554.5013\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"410.0001,-554.298 406.5,-544.2981 403.0001,-554.2981 410.0001,-554.298\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 3 -->\n",
       "<g class=\"node\" id=\"node4\">\n",
       "<title>3</title>\n",
       "<polygon fill=\"none\" points=\"115,-417.5 0,-417.5 0,-349.5 115,-349.5 115,-417.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"57.5\" y=\"-402.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"57.5\" y=\"-387.3\">samples = 1</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"57.5\" y=\"-372.3\">value = [1, 0]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"57.5\" y=\"-357.3\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 2&#45;&gt;3 -->\n",
       "<g class=\"edge\" id=\"edge3\">\n",
       "<title>2-&gt;3</title>\n",
       "<path d=\"M168.0422,-460.8796C150.6804,-448.7263 131.7512,-435.4759 114.5425,-423.4297\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"116.4467,-420.4904 106.2472,-417.623 112.4324,-426.225 116.4467,-420.4904\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 4 -->\n",
       "<g class=\"node\" id=\"node5\">\n",
       "<title>4</title>\n",
       "<polygon fill=\"none\" points=\"322,-425 133,-425 133,-342 322,-342 322,-425\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-409.8\">worst concave points &lt;= 0.111</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-394.8\">gini = 0.046</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-379.8\">samples = 214</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-364.8\">value = [5, 209]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"227.5\" y=\"-349.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 2&#45;&gt;4 -->\n",
       "<g class=\"edge\" id=\"edge4\">\n",
       "<title>2-&gt;4</title>\n",
       "<path d=\"M227.5,-460.8796C227.5,-452.6838 227.5,-443.9891 227.5,-435.5013\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"231.0001,-435.298 227.5,-425.2981 224.0001,-435.2981 231.0001,-435.298\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 5 -->\n",
       "<g class=\"node\" id=\"node6\">\n",
       "<title>5</title>\n",
       "<polygon fill=\"none\" points=\"171.5,-298.5 65.5,-298.5 65.5,-230.5 171.5,-230.5 171.5,-298.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118.5\" y=\"-283.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118.5\" y=\"-268.3\">samples = 185</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118.5\" y=\"-253.3\">value = [0, 185]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"118.5\" y=\"-238.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 4&#45;&gt;5 -->\n",
       "<g class=\"edge\" id=\"edge5\">\n",
       "<title>4-&gt;5</title>\n",
       "<path d=\"M189.3771,-341.8796C178.8014,-330.3337 167.3188,-317.7976 156.7367,-306.2446\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"159.2667,-303.825 149.9313,-298.8149 154.1049,-308.5531 159.2667,-303.825\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 6 -->\n",
       "<g class=\"node\" id=\"node7\">\n",
       "<title>6</title>\n",
       "<polygon fill=\"none\" points=\"391.5,-306 189.5,-306 189.5,-223 391.5,-223 391.5,-306\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"290.5\" y=\"-290.8\">mean fractal dimension &lt;= 0.056</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"290.5\" y=\"-275.8\">gini = 0.285</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"290.5\" y=\"-260.8\">samples = 29</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"290.5\" y=\"-245.8\">value = [5, 24]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"290.5\" y=\"-230.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 4&#45;&gt;6 -->\n",
       "<g class=\"edge\" id=\"edge6\">\n",
       "<title>4-&gt;6</title>\n",
       "<path d=\"M249.5343,-341.8796C254.064,-333.3236 258.8815,-324.2238 263.5618,-315.3833\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"266.7859,-316.7736 268.3716,-306.2981 260.5994,-313.4983 266.7859,-316.7736\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 7 -->\n",
       "<g class=\"node\" id=\"node8\">\n",
       "<title>7</title>\n",
       "<polygon fill=\"none\" points=\"274,-179.5 159,-179.5 159,-111.5 274,-111.5 274,-179.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"216.5\" y=\"-164.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"216.5\" y=\"-149.3\">samples = 3</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"216.5\" y=\"-134.3\">value = [3, 0]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"216.5\" y=\"-119.3\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 6&#45;&gt;7 -->\n",
       "<g class=\"edge\" id=\"edge7\">\n",
       "<title>6-&gt;7</title>\n",
       "<path d=\"M264.6184,-222.8796C257.7121,-211.7735 250.2361,-199.7513 243.2825,-188.5691\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"246.0917,-186.4587 237.8387,-179.8149 240.1473,-190.1552 246.0917,-186.4587\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 8 -->\n",
       "<g class=\"node\" id=\"node9\">\n",
       "<title>8</title>\n",
       "<polygon fill=\"none\" points=\"436.5,-187 292.5,-187 292.5,-104 436.5,-104 436.5,-187\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"364.5\" y=\"-171.8\">worst texture &lt;= 33.23</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"364.5\" y=\"-156.8\">gini = 0.142</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"364.5\" y=\"-141.8\">samples = 26</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"364.5\" y=\"-126.8\">value = [2, 24]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"364.5\" y=\"-111.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 6&#45;&gt;8 -->\n",
       "<g class=\"edge\" id=\"edge8\">\n",
       "<title>6-&gt;8</title>\n",
       "<path d=\"M316.3816,-222.8796C321.8142,-214.1434 327.5992,-204.8404 333.2053,-195.8253\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"336.1993,-197.6383 338.5079,-187.2981 330.2549,-193.9418 336.1993,-197.6383\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 9 -->\n",
       "<g class=\"node\" id=\"node10\">\n",
       "<title>9</title>\n",
       "<polygon fill=\"none\" points=\"351,-68 252,-68 252,0 351,0 351,-68\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"301.5\" y=\"-52.8\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"301.5\" y=\"-37.8\">samples = 24</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"301.5\" y=\"-22.8\">value = [0, 24]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"301.5\" y=\"-7.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 8&#45;&gt;9 -->\n",
       "<g class=\"edge\" id=\"edge9\">\n",
       "<title>8-&gt;9</title>\n",
       "<path d=\"M341.0411,-103.9815C336.1078,-95.2504 330.8926,-86.0202 325.9248,-77.2281\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"328.8263,-75.2483 320.8597,-68.2637 322.7319,-78.6918 328.8263,-75.2483\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 10 -->\n",
       "<g class=\"node\" id=\"node11\">\n",
       "<title>10</title>\n",
       "<polygon fill=\"none\" points=\"484,-68 369,-68 369,0 484,0 484,-68\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"426.5\" y=\"-52.8\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"426.5\" y=\"-37.8\">samples = 2</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"426.5\" y=\"-22.8\">value = [2, 0]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"426.5\" y=\"-7.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 8&#45;&gt;10 -->\n",
       "<g class=\"edge\" id=\"edge10\">\n",
       "<title>8-&gt;10</title>\n",
       "<path d=\"M387.5865,-103.9815C392.4415,-95.2504 397.574,-86.0202 402.4629,-77.2281\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"405.6467,-78.7043 407.4476,-68.2637 399.5288,-75.3025 405.6467,-78.7043\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 12 -->\n",
       "<g class=\"node\" id=\"node13\">\n",
       "<title>12</title>\n",
       "<polygon fill=\"none\" points=\"437,-417.5 340,-417.5 340,-349.5 437,-349.5 437,-417.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"388.5\" y=\"-402.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"388.5\" y=\"-387.3\">samples = 2</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"388.5\" y=\"-372.3\">value = [0, 2]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"388.5\" y=\"-357.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 11&#45;&gt;12 -->\n",
       "<g class=\"edge\" id=\"edge12\">\n",
       "<title>11-&gt;12</title>\n",
       "<path d=\"M400.2045,-460.8796C398.5911,-450.2134 396.8499,-438.7021 395.2162,-427.9015\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"398.6468,-427.179 393.6905,-417.8149 391.7255,-428.226 398.6468,-427.179\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 13 -->\n",
       "<g class=\"node\" id=\"node14\">\n",
       "<title>13</title>\n",
       "<polygon fill=\"none\" points=\"626,-425 455,-425 455,-342 626,-342 626,-425\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.5\" y=\"-409.8\">worst smoothness &lt;= 0.088</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.5\" y=\"-394.8\">gini = 0.111</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.5\" y=\"-379.8\">samples = 17</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.5\" y=\"-364.8\">value = [16, 1]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"540.5\" y=\"-349.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 11&#45;&gt;13 -->\n",
       "<g class=\"edge\" id=\"edge13\">\n",
       "<title>11-&gt;13</title>\n",
       "<path d=\"M453.3667,-460.8796C463.8125,-451.6031 474.9781,-441.6874 485.711,-432.1559\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"488.2801,-434.5553 493.4333,-425.2981 483.632,-429.3213 488.2801,-434.5553\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 14 -->\n",
       "<g class=\"node\" id=\"node15\">\n",
       "<title>14</title>\n",
       "<polygon fill=\"none\" points=\"543,-298.5 446,-298.5 446,-230.5 543,-230.5 543,-298.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"494.5\" y=\"-283.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"494.5\" y=\"-268.3\">samples = 1</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"494.5\" y=\"-253.3\">value = [0, 1]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"494.5\" y=\"-238.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 13&#45;&gt;14 -->\n",
       "<g class=\"edge\" id=\"edge14\">\n",
       "<title>13-&gt;14</title>\n",
       "<path d=\"M524.4114,-341.8796C520.2034,-330.9935 515.655,-319.227 511.4057,-308.2344\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"514.6348,-306.8804 507.7646,-298.8149 508.1056,-309.4043 514.6348,-306.8804\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 15 -->\n",
       "<g class=\"node\" id=\"node16\">\n",
       "<title>15</title>\n",
       "<polygon fill=\"none\" points=\"676,-298.5 561,-298.5 561,-230.5 676,-230.5 676,-298.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"618.5\" y=\"-283.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"618.5\" y=\"-268.3\">samples = 16</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"618.5\" y=\"-253.3\">value = [16, 0]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"618.5\" y=\"-238.3\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 13&#45;&gt;15 -->\n",
       "<g class=\"edge\" id=\"edge15\">\n",
       "<title>13-&gt;15</title>\n",
       "<path d=\"M567.7806,-341.8796C575.1323,-330.6636 583.0964,-318.5131 590.4874,-307.2372\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"593.4531,-309.0972 596.0079,-298.8149 587.5986,-305.2598 593.4531,-309.0972\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 17 -->\n",
       "<g class=\"node\" id=\"node18\">\n",
       "<title>17</title>\n",
       "<polygon fill=\"none\" points=\"607,-536.5 510,-536.5 510,-468.5 607,-468.5 607,-536.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-521.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-506.3\">samples = 2</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-491.3\">value = [0, 2]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"558.5\" y=\"-476.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 16&#45;&gt;17 -->\n",
       "<g class=\"edge\" id=\"edge17\">\n",
       "<title>16-&gt;17</title>\n",
       "<path d=\"M558.5,-579.8796C558.5,-569.2134 558.5,-557.7021 558.5,-546.9015\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"562.0001,-546.8149 558.5,-536.8149 555.0001,-546.815 562.0001,-546.8149\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 18 -->\n",
       "<g class=\"node\" id=\"node19\">\n",
       "<title>18</title>\n",
       "<polygon fill=\"none\" points=\"755,-544 630,-544 630,-461 755,-461 755,-544\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-528.8\">area error &lt;= 13.93</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-513.8\">gini = 0.037</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-498.8\">samples = 105</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-483.8\">value = [103, 2]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-468.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 16&#45;&gt;18 -->\n",
       "<g class=\"edge\" id=\"edge18\">\n",
       "<title>16-&gt;18</title>\n",
       "<path d=\"M605.3667,-579.8796C615.8125,-570.6031 626.9781,-560.6874 637.711,-551.1559\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"640.2801,-553.5553 645.4333,-544.2981 635.632,-548.3213 640.2801,-553.5553\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 19 -->\n",
       "<g class=\"node\" id=\"node20\">\n",
       "<title>19</title>\n",
       "<polygon fill=\"none\" points=\"741,-417.5 644,-417.5 644,-349.5 741,-349.5 741,-417.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-402.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-387.3\">samples = 1</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-372.3\">value = [0, 1]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"692.5\" y=\"-357.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 18&#45;&gt;19 -->\n",
       "<g class=\"edge\" id=\"edge19\">\n",
       "<title>18-&gt;19</title>\n",
       "<path d=\"M692.5,-460.8796C692.5,-450.2134 692.5,-438.7021 692.5,-427.9015\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"696.0001,-427.8149 692.5,-417.8149 689.0001,-427.815 696.0001,-427.8149\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 20 -->\n",
       "<g class=\"node\" id=\"node21\">\n",
       "<title>20</title>\n",
       "<polygon fill=\"none\" points=\"919.5,-425 759.5,-425 759.5,-342 919.5,-342 919.5,-425\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"839.5\" y=\"-409.8\">worst concavity &lt;= 0.203</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"839.5\" y=\"-394.8\">gini = 0.019</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"839.5\" y=\"-379.8\">samples = 104</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"839.5\" y=\"-364.8\">value = [103, 1]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"839.5\" y=\"-349.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 18&#45;&gt;20 -->\n",
       "<g class=\"edge\" id=\"edge20\">\n",
       "<title>18-&gt;20</title>\n",
       "<path d=\"M743.9135,-460.8796C755.5952,-451.4229 768.0975,-441.302 780.081,-431.6011\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"782.2968,-434.3105 787.8671,-425.2981 777.8924,-428.8697 782.2968,-434.3105\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 21 -->\n",
       "<g class=\"node\" id=\"node22\">\n",
       "<title>21</title>\n",
       "<polygon fill=\"none\" points=\"809,-298.5 712,-298.5 712,-230.5 809,-230.5 809,-298.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.5\" y=\"-283.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.5\" y=\"-268.3\">samples = 1</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.5\" y=\"-253.3\">value = [0, 1]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"760.5\" y=\"-238.3\">class = benign</text>\n",
       "</g>\n",
       "<!-- 20&#45;&gt;21 -->\n",
       "<g class=\"edge\" id=\"edge21\">\n",
       "<title>20-&gt;21</title>\n",
       "<path d=\"M811.8696,-341.8796C804.4237,-330.6636 796.3575,-318.5131 788.8718,-307.2372\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"791.7273,-305.2104 783.2805,-298.8149 785.8954,-309.082 791.7273,-305.2104\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "<!-- 22 -->\n",
       "<g class=\"node\" id=\"node23\">\n",
       "<title>22</title>\n",
       "<polygon fill=\"none\" points=\"942,-298.5 827,-298.5 827,-230.5 942,-230.5 942,-298.5\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"884.5\" y=\"-283.3\">gini = 0.0</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"884.5\" y=\"-268.3\">samples = 103</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"884.5\" y=\"-253.3\">value = [103, 0]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"884.5\" y=\"-238.3\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 20&#45;&gt;22 -->\n",
       "<g class=\"edge\" id=\"edge22\">\n",
       "<title>20-&gt;22</title>\n",
       "<path d=\"M855.2388,-341.8796C859.3554,-330.9935 863.8049,-319.227 867.9618,-308.2344\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"871.2604,-309.4065 871.5238,-298.8149 864.7129,-306.9305 871.2604,-309.4065\" stroke=\"#000000\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
TheophilePACE's avatar
TheophilePACE committed
1263 1264
   "source": [
    "# Déclarer le classifieur, avec si nécessaire les hyperparamètres\n",
TheophilePACE's avatar
TheophilePACE committed
1265
    "clf = DecisionTreeClassifier()\n",
TheophilePACE's avatar
TheophilePACE committed
1266
    "# Entrainer les hyperparamètres\n",
TheophilePACE's avatar
TheophilePACE committed
1267
    "clf.fit(X=X_train,y=y_train)\n",
TheophilePACE's avatar
TheophilePACE committed
1268
    "# Prédire sur l'ensemble de validation\n",
TheophilePACE's avatar
TheophilePACE committed
1269
    "y_hat = clf.predict(X_validation)\n",
TheophilePACE's avatar
TheophilePACE committed
1270
    "# Regarder les résultats\n",
TheophilePACE's avatar
TheophilePACE committed
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
    "accuracy_score(y_pred=y_hat,y_true=y_validation)\n",
    "visualize_tree(clf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.47 ms ± 39.2 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit clf.fit(X=X_train,y=y_train)"
TheophilePACE's avatar
TheophilePACE committed
1290
   ]
1291
  },
1292 1293 1294 1295
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
1296
    "Bravo! Vous venez de découvrir l'*overfitting*!! C'est-à-dire que votre arbre a tout appris par coeur, et a donc trop de branches. On va donc faire de l'élagage, c'est à dire limiter le nombre de noeuds / bbranches/ fueilles. Ce point est géré par l'hyperparamètre `max_depth`. Essayer avec `max_depth=1`, puis quelques autres valeurs. Vous pouvez comparer les accuracies obtenues sur l'ensembble de validation."
1297 1298
   ]
  },
1299 1300
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
1301
   "execution_count": 43,
1302
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9122807017543859\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<svg height=\"195pt\" viewBox=\"0.00 0.00 254.00 195.00\" width=\"254pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g class=\"graph\" id=\"graph0\" transform=\"scale(1 1) rotate(0) translate(4 191)\">\n",
       "<title>Tree</title>\n",
       "<polygon fill=\"#ffffff\" points=\"-4,4 -4,-191 250,-191 250,4 -4,4\" stroke=\"transparent\"/>\n",
       "<!-- 0 -->\n",
       "<g class=\"node\" id=\"node1\">\n",
       "<title>0</title>\n",
       "<polygon fill=\"none\" points=\"217,-187 28,-187 28,-104 217,-104 217,-187\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"122.5\" y=\"-171.8\">worst concave points &lt;= 0.142</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"122.5\" y=\"-156.8\">gini = 0.464</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"122.5\" y=\"-141.8\">samples = 341</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"122.5\" y=\"-126.8\">value = [125, 216]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"122.5\" y=\"-111.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 1 -->\n",
       "<g class=\"node\" id=\"node2\">\n",
       "<title>1</title>\n",
       "<polygon fill=\"none\" points=\"113,-68 0,-68 0,0 113,0 113,-68\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56.5\" y=\"-52.8\">gini = 0.17</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56.5\" y=\"-37.8\">samples = 234</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56.5\" y=\"-22.8\">value = [22, 212]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"56.5\" y=\"-7.8\">class = benign</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;1 -->\n",
       "<g class=\"edge\" id=\"edge1\">\n",
       "<title>0-&gt;1</title>\n",
       "<path d=\"M97.924,-103.9815C92.7014,-95.1585 87.1771,-85.8258 81.9237,-76.9506\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"84.8874,-75.0863 76.7816,-68.2637 78.8636,-78.652 84.8874,-75.0863\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"70.5739\" y=\"-88.7807\">True</text>\n",
       "</g>\n",
       "<!-- 2 -->\n",
       "<g class=\"node\" id=\"node3\">\n",
       "<title>2</title>\n",
       "<polygon fill=\"none\" points=\"246,-68 131,-68 131,0 246,0 246,-68\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"188.5\" y=\"-52.8\">gini = 0.072</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"188.5\" y=\"-37.8\">samples = 107</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"188.5\" y=\"-22.8\">value = [103, 4]</text>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"188.5\" y=\"-7.8\">class = malignant</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;2 -->\n",
       "<g class=\"edge\" id=\"edge2\">\n",
       "<title>0-&gt;2</title>\n",
       "<path d=\"M147.076,-103.9815C152.2986,-95.1585 157.8229,-85.8258 163.0763,-76.9506\" fill=\"none\" stroke=\"#000000\"/>\n",
       "<polygon fill=\"#000000\" points=\"166.1364,-78.652 168.2184,-68.2637 160.1126,-75.0863 166.1364,-78.652\" stroke=\"#000000\"/>\n",
       "<text fill=\"#000000\" font-family=\"Times,serif\" font-size=\"14.00\" text-anchor=\"middle\" x=\"174.4261\" y=\"-88.7807\">False</text>\n",
       "</g>\n",
       "</g>\n",
       "</svg>"
      ],
      "text/plain": [
       "<IPython.core.display.SVG object>"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
TheophilePACE's avatar
TheophilePACE committed
1372 1373
   "source": [
    "# Déclarer le classifieur, avec un hyperparamètre max_depth\n",
TheophilePACE's avatar
TheophilePACE committed
1374 1375 1376 1377 1378
    "clf = DecisionTreeClassifier(max_depth=1)\n",
    "clf.fit(X_train,y_train)\n",
    "y_hat = clf.predict(X_validation)\n",
    "print(accuracy_score(y_hat,y_validation))\n",
    "visualize_tree(clf)"
TheophilePACE's avatar
TheophilePACE committed
1379
   ]
1380 1381 1382 1383 1384
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
1385 1386 1387 1388 1389
    "Évidemment, cela n'est pas satisfaisant! On va donc effectuer une recherche sur le paramètre `max_depth`"
   ]
  },
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
1390
   "execution_count": 48,
TheophilePACE's avatar
TheophilePACE committed
1391
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a17113668>]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJztvXuQI+d12Ps7A2BmgN3BLGZ3udxdgEtJZiStJYYMGZqSLZOScx0qVvQgcx2pFFl2pcLyQ5WkcukrMkp0K0xYsnKVK8dllW9oR5IZWWFkxo51Fdq0wpCy4tJrKb60opZa0RKBneHukMA8dgHMDIBz/+huTC+mgW7M4DWD86uaGqDRaHwf0P2dPm9RVQzDMAxjYtgDMAzDMEYDEwiGYRgGYALBMAzDcDGBYBiGYQAmEAzDMAwXEwiGYRgGYALBMAzDcDGBYBiGYQAmEAzDMAyX+LAH0A2HDh3Sq6++etjDMAzD2FU88cQTL6vq4bD9dpVAuPrqqzl16tSwh2EYhrGrEJEfRdnPTEaGYRgGYALBMAzDcDGBYBiGYQAmEAzDMAwXEwiGYRgGYALBMAzDcDGBYBiGYQAmEMaaR587T6FUHvYwdky9oTz4zRfZqDeGPRTDCOXPvrPA4urasIcRiAmEMUVV+ZU/+Da/+xcvDHsoO+brL7zC3X/0LI+fWRz2UAyjI+X1Gr/8uW/z4DdfHPZQAjGBMKZUNu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sz/o/Ac6r6//he2vPzF5HDrmaAiCSBv4XjQ3kM+Hvubnty7gCqeo+qZlX1apzr/H+q6vsZg/mLyD4RmfEeAz8LfIcenvd7JjFNRP4Ozp1CDPi0qt435CH1FRH5z8CtOJUOzwP/F/DfgC8AVwEvAv+7qrY6nnc9IvJTwFeBZ9m0I/9zHD/Cnp6/iFyL4ziM4dzQfUFV7xWRV+PcMc8BTwL/QFXXhjfS/uOajO5S1XeMw/zdOf6x+zQOfF5V7xORg/TovN8zAsEwDMPYGXvFZGQYhmHsEBMIhmEYBmACwTAMw3AxgWAYhmEAJhAMwzAMFxMIhmEYBmACwTAMw3AxgWAYhmEA8P8D5r0CHWGIDpEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
TheophilePACE's avatar
TheophilePACE committed
1414 1415 1416 1417
   "source": [
    "def search_best_depth(maximum_depth:int):\n",
    "    accuracies = []\n",
    "    for depth in range(1,maximum_depth):\n",
TheophilePACE's avatar
TheophilePACE committed
1418 1419 1420 1421 1422
    "        clf = DecisionTreeClassifier(max_depth=depth)\n",
    "        # train\n",
    "        clf.fit(X_train,y_train)\n",
    "        y_hat = clf.predict(X_validation)\n",
    "        accuracy = accuracy_score(y_hat,y_validation)\n",
TheophilePACE's avatar
TheophilePACE committed
1423 1424 1425 1426 1427
    "        # stocker l'accuracy dans accuracies\n",
    "        accuracies.append(accuracy)\n",
    "    return accuracies\n",
    "\n",
    "# On entraine notre arbre!\n",
TheophilePACE's avatar
TheophilePACE committed
1428
    "maximum_depth = 50\n",
TheophilePACE's avatar
TheophilePACE committed
1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448
    "accuracies_tree = search_best_depth(maximum_depth)\n",
    "plt.plot(range(1,len(accuracies_tree)+1), accuracies_tree)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Quel `max_depth` choisissez-vous ? On va entrainer notre classifieur avec cette hyperparamètre, puis essayer sur test."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Réentrainner avec le max_depth choisi\n",
    "\n",
    "# Prédire test, comparer avec les autres"
1449 1450
   ]
  },
1451 1452 1453 1454
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
1455
    "**optionel** tracer votre arbre en 2D. Vous pouvez utiliser le tuto suivant: https://scikit-learn.org/stable/auto_examples/tree/plot_iris.html#sphx-glr-auto-examples-tree-plot-iris-py"
1456 1457
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
1458 1459 1460 1461 1462 1463 1464
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
1465 1466 1467 1468 1469
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Random Forest\n",
1470
    "Les forêts aléatoires sont des classifieurs extrêmement puissants, qui s'appuient sur le bootstrap, et le bagging. Ce sont des techniques statistiques assez avancées qui consistent à:\n",
1471 1472
    "- *bootstrap*: faire des tirages avec remise dans le jeu de données\n",
    "- *bagging*: entrainer le même modèle sur différents bootstrap, et faire un vote pour classifier.\n",
1473
    "\n",
TheophilePACE's avatar
TheophilePACE committed
1474 1475 1476 1477
    "Schématiquement:\n",
    "\n",
    "![](https://www.researchgate.net/profile/Evaldas_Vaiciukynas/publication/301411533/figure/fig1/AS:401835392290816@1472816431620/A-general-random-forest-architecture.png)\n",
    "\n",
1478 1479
    "Problème: l'interprétation devient plus difficile avec tous les arbres.\n",
    "\n",
1480 1481 1482 1483 1484 1485 1486
    "La documentation est disponible à https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
1487 1488
    "Après avoir regardé la documentation, lancez une random forest avec `n_estimators = 15`:\n",
    "_Note: relancer plusieurs fois, le bootstrap repose sur de l'aléatoire_"
1489 1490 1491
   ]
  },
  {
1492
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
1493
   "execution_count": 51,
1494
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
1495 1496 1497 1498
   "outputs": [
    {
     "data": {
      "text/plain": [
1499
       "0.956140350877193"
TheophilePACE's avatar
TheophilePACE committed
1500 1501
      ]
     },
TheophilePACE's avatar
TheophilePACE committed
1502
     "execution_count": 51,
TheophilePACE's avatar
TheophilePACE committed
1503 1504 1505 1506 1507 1508
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.ensemble import RandomForestClassifier\n",
TheophilePACE's avatar
TheophilePACE committed
1509
    "clf = RandomForestClassifier(n_estimators=501)\n",
TheophilePACE's avatar
TheophilePACE committed
1510 1511 1512 1513
    "clf.fit(X=X_train,y=y_train)\n",
    "y_hat = clf.predict(X_validation)\n",
    "accuracy_score(y_pred=y_hat,y_true=y_validation)"
   ]
1514 1515 1516 1517 1518
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
1519
    "Comparez vos résultats avec ceux obtenu avec un arbre (`DecisionTreeClassifier`). Regardez bien sur l'ensemble de test puis sur l'ensemble de validation. Que remarquez-vous? À quoi cela est dû?"
1520 1521
   ]
  },
TheophilePACE's avatar
TheophilePACE committed
1522 1523
  {
   "cell_type": "code",
TheophilePACE's avatar
TheophilePACE committed
1524
   "execution_count": 54,
TheophilePACE's avatar
TheophilePACE committed
1525
   "metadata": {},
TheophilePACE's avatar
TheophilePACE committed
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.0\n",
      "1.0\n"
     ]
    }
   ],
   "source": [
    "decision_tree = DecisionTreeClassifier(max_depth=10)\n",
    "decision_tree.fit(X_train,y_train)\n",
    "print(accuracy_score(decision_tree.predict(X_train),y_train))\n",
    "print(accuracy_score(clf.predict(X_train),y_train))"
   ]
TheophilePACE's avatar
TheophilePACE committed
1542
  },
1543 1544 1545 1546
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
TheophilePACE's avatar
TheophilePACE committed
1547
    "Rééssayez avec  `n_estimators = 100`,  `n_estimators = 500`. "
1548 1549 1550 1551 1552 1553 1554 1555 1556 1557
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
1558
   "cell_type": "markdown",
1559
   "metadata": {},
1560 1561 1562
   "source": [
    "Comparez vos résultats. "
   ]
TheophilePACE's avatar
TheophilePACE committed
1563 1564 1565 1566 1567 1568 1569 1570
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Si vous vous ennuyez\n",
    "Faites les visualisations en __optionel__"
   ]
1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
TheophilePACE's avatar
TheophilePACE committed
1589
   "version": "3.6.6"
1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613
  },
  "toc": {
   "colors": {
    "hover_highlight": "#DAA520",
    "navigate_num": "#000000",
    "navigate_text": "#333333",
    "running_highlight": "#FF0000",
    "selected_highlight": "#FFD700",
    "sidebar_border": "#EEEEEE",
    "wrapper_background": "#FFFFFF"
   },
   "moveMenuLeft": true,
   "nav_menu": {
    "height": "192px",
    "width": "252px"
   },
   "navigate_menu": true,
   "number_sections": true,
   "sideBar": true,
   "threshold": 4,
   "toc_cell": false,
   "toc_section_display": "block",
   "toc_window_display": false,
   "widenNotebook": false
1614 1615 1616 1617 1618
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}