{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "08e53f3f",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
      "I0000 00:00:1788414583.218315   23312 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
      "I0000 00:00:1788414583.219956   23312 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.\n",
      "I0000 00:00:1788414583.489015   23312 cpu_feature_guard.cc:227] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
      "To enable the following instructions: AVX2 AVX_VNNI AVX_VNNI_INT8 AVX_NE_CONVERT FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
      "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
      "I0000 00:00:1788414585.253354   23312 port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
      "I0000 00:00:1788414585.253946   23312 cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used.\n"
     ]
    }
   ],
   "source": [
    "#svm\n",
    "from tensorflow.keras import datasets\n",
    "from sklearn.model_selection import train_test_split\n",
    "import numpy as np\n",
    "import cv2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "b7c72748",
   "metadata": {},
   "outputs": [],
   "source": [
    "TRAIN_SIZE = 5000\n",
    "TEST_SIZE = 1000\n",
    "\n",
    "(x_train_raw, y_train_raw), (x_test_raw, y_test_raw) = datasets.mnist.load_data()\n",
    "\n",
    "x_train_sub, _, y_train_sub, _ = train_test_split(\n",
    "    x_train_raw, y_train_raw,\n",
    "    train_size=TRAIN_SIZE,\n",
    "    stratify=y_train_raw,\n",
    "    random_state=42\n",
    ")\n",
    "\n",
    "x_test_sub, _, y_test_sub, _ = train_test_split(\n",
    "    x_test_raw, y_test_raw,\n",
    "    train_size=TEST_SIZE,\n",
    "    stratify=y_test_raw,\n",
    "    random_state=42\n",
    ")\n",
    "\n",
    "x_train_eq = np.array([cv2.equalizeHist(img) for img in x_train_sub])\n",
    "x_test_eq = np.array([cv2.equalizeHist(img) for img in x_test_sub])\n",
    "\n",
    "\n",
    "x_train_flat = x_train_eq.reshape(-1, 28 * 28) / 255.0\n",
    "x_test_flat = x_test_eq.reshape(-1, 28 * 28) / 255.0\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b944ab65",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>.sk-global {\n",
       "  /* Definition of color scheme common for light and dark mode */\n",
       "  --sklearn-color-text: #000;\n",
       "  --sklearn-color-text-muted: #666;\n",
       "  --sklearn-color-line: gray;\n",
       "  /* Definition of color scheme for unfitted estimators */\n",
       "  --sklearn-color-unfitted-level-0: #fff5e6;\n",
       "  --sklearn-color-unfitted-level-1: #f6e4d2;\n",
       "  --sklearn-color-unfitted-level-2: #ffe0b3;\n",
       "  --sklearn-color-unfitted-level-3: chocolate;\n",
       "  /* Definition of color scheme for fitted estimators */\n",
       "  --sklearn-color-fitted-level-0: #f0f8ff;\n",
       "  --sklearn-color-fitted-level-1: #d4ebff;\n",
       "  --sklearn-color-fitted-level-2: #b3dbfd;\n",
       "  --sklearn-color-fitted-level-3: cornflowerblue;\n",
       "}\n",
       "\n",
       ".sk-global.light {\n",
       "  /* Specific color for light theme */\n",
       "  --sklearn-color-text-on-default-background: black;\n",
       "  --sklearn-color-background: white;\n",
       "  --sklearn-color-border-box: black;\n",
       "  --sklearn-color-icon: #696969;\n",
       "}\n",
       "\n",
       ".sk-global.dark {\n",
       "  --sklearn-color-text-on-default-background: white;\n",
       "  --sklearn-color-background: #111;\n",
       "  --sklearn-color-border-box: white;\n",
       "  --sklearn-color-icon: #878787;\n",
       "}\n",
       "\n",
       ".sk-global {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       ".sk-global pre {\n",
       "  padding: 0;\n",
       "}\n",
       "\n",
       ".sk-global input.sk-hidden--visually {\n",
       "  border: 0;\n",
       "  clip-path: inset(100%);\n",
       "  height: 1px;\n",
       "  margin: -1px;\n",
       "  overflow: hidden;\n",
       "  padding: 0;\n",
       "  position: absolute;\n",
       "  width: 1px;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-dashed-wrapped {\n",
       "  border: 1px dashed var(--sklearn-color-line);\n",
       "  margin: 0 0.4em 0.5em 0.4em;\n",
       "  box-sizing: border-box;\n",
       "  padding-bottom: 0.4em;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-container {\n",
       "  /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
       "     but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
       "     so we also need the `!important` here to be able to override the\n",
       "     default hidden behavior on the sphinx rendered scikit-learn.org.\n",
       "     See: https://github.com/scikit-learn/scikit-learn/issues/21755 */\n",
       "  display: inline-block !important;\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-text-repr-fallback {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       "div.sk-parallel-item,\n",
       "div.sk-serial,\n",
       "div.sk-item {\n",
       "  /* draw centered vertical line to link estimators */\n",
       "  background-image: linear-gradient(var(--sklearn-color-text-on-default-background), var(--sklearn-color-text-on-default-background));\n",
       "  background-size: 2px 100%;\n",
       "  background-repeat: no-repeat;\n",
       "  background-position: center center;\n",
       "}\n",
       "\n",
       "/* Parallel-specific style estimator block */\n",
       "\n",
       ".sk-global div.sk-parallel-item::after {\n",
       "  content: \"\";\n",
       "  width: 100%;\n",
       "  border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
       "  flex-grow: 1;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-parallel {\n",
       "  display: flex;\n",
       "  align-items: stretch;\n",
       "  justify-content: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  position: relative;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-parallel-item {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-parallel-item:first-child::after {\n",
       "  align-self: flex-end;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-parallel-item:last-child::after {\n",
       "  align-self: flex-start;\n",
       "  width: 50%;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-parallel-item:only-child::after {\n",
       "  width: 0;\n",
       "}\n",
       "\n",
       "/* Serial-specific style estimator block */\n",
       "\n",
       ".sk-global div.sk-serial {\n",
       "  display: flex;\n",
       "  flex-direction: column;\n",
       "  align-items: center;\n",
       "  background-color: var(--sklearn-color-background);\n",
       "  padding-right: 1em;\n",
       "  padding-left: 1em;\n",
       "}\n",
       "\n",
       "\n",
       "/* Toggleable style: style used for estimator/Pipeline/ColumnTransformer box that is\n",
       "clickable and can be expanded/collapsed.\n",
       "- Pipeline and ColumnTransformer use this feature and define the default style\n",
       "- Estimators will overwrite some part of the style using the `sk-estimator` class\n",
       "*/\n",
       "\n",
       "/* Pipeline and ColumnTransformer style (default) */\n",
       "\n",
       ".sk-global div.sk-toggleable {\n",
       "  /* Default theme specific background. It is overwritten whether we have a\n",
       "  specific estimator or a Pipeline/ColumnTransformer */\n",
       "  background-color: var(--sklearn-color-background);\n",
       "}\n",
       "\n",
       "/* Toggleable label */\n",
       ".sk-global label.sk-toggleable__label {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  width: 100%;\n",
       "  margin-bottom: 0;\n",
       "  padding: 0.5em;\n",
       "  box-sizing: border-box;\n",
       "  text-align: center;\n",
       "  align-items: center;\n",
       "  justify-content: center;\n",
       "  gap: 0.5em;\n",
       "}\n",
       "\n",
       ".sk-global label.sk-toggleable__label .caption {\n",
       "  font-size: 0.6rem;\n",
       "  font-weight: lighter;\n",
       "  color: var(--sklearn-color-text-muted);\n",
       "}\n",
       "\n",
       ".sk-global label.sk-toggleable__label-arrow:before {\n",
       "  /* Arrow on the left of the label */\n",
       "  content: \"▸\";\n",
       "  float: left;\n",
       "  margin-right: 0.25em;\n",
       "  color: var(--sklearn-color-icon);\n",
       "}\n",
       "\n",
       ".sk-global label.sk-toggleable__label-arrow:hover:before {\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       "/* Toggleable content - dropdown */\n",
       "\n",
       ".sk-global div.sk-toggleable__content {\n",
       "  display: none;\n",
       "  text-align: left;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-toggleable__content.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-toggleable__content pre {\n",
       "  margin: 0.2em;\n",
       "  border-radius: 0.25em;\n",
       "  color: var(--sklearn-color-text);\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-toggleable__content.fitted pre {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       ".sk-global input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
       "  /* Expand drop-down */\n",
       "  display: block;\n",
       "  width: 100%;\n",
       "  overflow: visible;\n",
       "}\n",
       "\n",
       ".sk-global input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       "/* Pipeline/ColumnTransformer-specific style */\n",
       "\n",
       ".sk-global div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator-specific style */\n",
       "\n",
       "/* Colorize estimator box */\n",
       ".sk-global div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-label label.sk-toggleable__label,\n",
       ".sk-global div.sk-label label {\n",
       "  /* The background is the default theme color */\n",
       "  color: var(--sklearn-color-text-on-default-background);\n",
       "}\n",
       "\n",
       "/* On hover, darken the color of the background */\n",
       ".sk-global div.sk-label:hover label.sk-toggleable__label {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       "/* Label box, darken color on hover, fitted */\n",
       ".sk-global div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Estimator label */\n",
       "\n",
       ".sk-global div.sk-label label {\n",
       "  font-family: monospace;\n",
       "  font-weight: bold;\n",
       "  line-height: 1.2em;\n",
       "}\n",
       "\n",
       ".sk-global div.sk-label-container {\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       "/* Estimator-specific */\n",
       ".sk-global div.sk-estimator {\n",
       "  font-family: monospace;\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: 0.25em;\n",
       "  box-sizing: border-box;\n",
       "  margin-bottom: 0.5em;\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-estimator.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       "/* on hover */\n",
       ".sk-global div.sk-estimator:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       ".sk-global div.sk-estimator.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       "/* Specification for estimator info (e.g. \"i\" and \"?\") */\n",
       "\n",
       "/* Common style for \"i\" and \"?\" */\n",
       "\n",
       ".sk-estimator-doc-link,\n",
       "a:link.sk-estimator-doc-link,\n",
       "a:visited.sk-estimator-doc-link {\n",
       "  float: right;\n",
       "  font-size: smaller;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "  border-radius: 1em;\n",
       "  height: 1em;\n",
       "  width: 1em;\n",
       "  text-decoration: none !important;\n",
       "  margin-left: 0.5em;\n",
       "  text-align: center;\n",
       "  /* unfitted */\n",
       "  border: var(--sklearn-color-unfitted-level-3) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted,\n",
       "a:link.sk-estimator-doc-link.fitted,\n",
       "a:visited.sk-estimator-doc-link.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       "div.sk-estimator:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link:hover,\n",
       ".sk-estimator-doc-link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  border: var(--sklearn-color-fitted-level-0) 1pt solid;\n",
       "  color: var(--sklearn-color-unfitted-level-0);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "div.sk-estimator.fitted:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover,\n",
       "div.sk-label-container:hover .sk-estimator-doc-link.fitted:hover,\n",
       ".sk-estimator-doc-link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "  border: var(--sklearn-color-fitted-level-0) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-0);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       "/* Span, style for the box shown on hovering the info icon */\n",
       ".sk-estimator-doc-link span {\n",
       "  display: none;\n",
       "  z-index: 9999;\n",
       "  position: relative;\n",
       "  font-weight: normal;\n",
       "  right: .2ex;\n",
       "  padding: .5ex;\n",
       "  margin: .5ex;\n",
       "  width: min-content;\n",
       "  min-width: 20ex;\n",
       "  max-width: 50ex;\n",
       "  color: var(--sklearn-color-text);\n",
       "  box-shadow: 2pt 2pt 4pt #999;\n",
       "  /* unfitted */\n",
       "  background: var(--sklearn-color-unfitted-level-0);\n",
       "  border: .5pt solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link.fitted span {\n",
       "  /* fitted */\n",
       "  background: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-estimator-doc-link:hover span {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       "/* \"?\"-specific style due to the `<a>` HTML tag */\n",
       "\n",
       ".sk-global a.estimator_doc_link {\n",
       "  float: right;\n",
       "  font-size: 1rem;\n",
       "  line-height: 1em;\n",
       "  font-family: monospace;\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "  border-radius: 1rem;\n",
       "  height: 1rem;\n",
       "  width: 1rem;\n",
       "  text-decoration: none;\n",
       "  /* unfitted */\n",
       "  color: var(--sklearn-color-unfitted-level-1);\n",
       "  border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
       "}\n",
       "\n",
       ".sk-global a.estimator_doc_link.fitted {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "  border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
       "  color: var(--sklearn-color-fitted-level-1);\n",
       "}\n",
       "\n",
       "/* On hover */\n",
       ".sk-global a.estimator_doc_link:hover {\n",
       "  /* unfitted */\n",
       "  background-color: var(--sklearn-color-unfitted-level-3);\n",
       "  color: var(--sklearn-color-background);\n",
       "  text-decoration: none;\n",
       "}\n",
       "\n",
       ".sk-global a.estimator_doc_link.fitted:hover {\n",
       "  /* fitted */\n",
       "  background-color: var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".sk-top-container.sk-global {\n",
       "  /* pydata-sphinx-theme hides overflow, so scrolling is disabled.\n",
       "   We need to set it to !important and add tabindex=\"0\" in the HTML\n",
       "   to allow keyboard-only users to navigate the display. */\n",
       "  overflow-x: scroll !important;\n",
       "  max-width: 100%;\n",
       "}\n",
       "\n",
       ".estimator-table {\n",
       "    font-family: monospace;\n",
       "}\n",
       "\n",
       ".estimator-table summary {\n",
       "    padding: .5rem;\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       ".estimator-table summary::marker {\n",
       "    font-size: 0.7rem;\n",
       "}\n",
       "\n",
       ".estimator-table details[open] {\n",
       "    padding-left: 0.1rem;\n",
       "    padding-right: 0.1rem;\n",
       "    padding-bottom: 0.3rem;\n",
       "}\n",
       "\n",
       ".estimator-table .parameters-table {\n",
       "    margin-left: auto !important;\n",
       "    margin-right: auto !important;\n",
       "    margin-top: 0;\n",
       "}\n",
       "\n",
       ".estimator-table .parameters-table tr:nth-child(odd) {\n",
       "    background-color: #fff;\n",
       "}\n",
       "\n",
       ".estimator-table .parameters-table tr:nth-child(even) {\n",
       "    background-color: #f6f6f6;\n",
       "}\n",
       "\n",
       ".estimator-table .parameters-table tr:hover td {\n",
       "    background-color: #e0e0e0;\n",
       "}\n",
       "\n",
       ".estimator-table table :is(td, th) {\n",
       "    border: 1px solid rgba(106, 105, 104, 0.232);\n",
       "}\n",
       "\n",
       "/*\n",
       "    `table td`is set in notebook with right text-align.\n",
       "    We need to overwrite it.\n",
       "*/\n",
       ".estimator-table table td.param {\n",
       "    text-align: left;\n",
       "    position: relative;\n",
       "    padding: 0;\n",
       "}\n",
       "\n",
       ".user-set td {\n",
       "    color:rgb(255, 94, 0);\n",
       "    text-align: left !important;\n",
       "}\n",
       "\n",
       ".user-set td.value {\n",
       "    color:rgb(255, 94, 0);\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       ".default td, .estimator-table th {\n",
       "    color: black;\n",
       "    text-align: left !important;\n",
       "}\n",
       "\n",
       ".user-set td i,\n",
       ".default td i {\n",
       "    color: black;\n",
       "}\n",
       "\n",
       "td.fitted-att-type {\n",
       "    white-space: preserve nowrap;\n",
       "}\n",
       "\n",
       "/*\n",
       "    Styles for parameter documentation links\n",
       "    We need styling for visited so jupyter doesn't overwrite it\n",
       "*/\n",
       "a.param-doc-link,\n",
       "a.param-doc-link:link,\n",
       "a.param-doc-link:visited {\n",
       "    text-decoration: underline dashed;\n",
       "    text-underline-offset: .3em;\n",
       "    color: inherit;\n",
       "    display: block;\n",
       "    padding: .5em;\n",
       "}\n",
       "\n",
       "@supports(anchor-name: --doc-link) {\n",
       "    a.param-doc-link,\n",
       "    a.param-doc-link:link,\n",
       "    a.param-doc-link:visited {\n",
       "    anchor-name: --doc-link;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* \"hack\" to make the entire area of the cell containing the link clickable */\n",
       "a.param-doc-link::before {\n",
       "    position: absolute;\n",
       "    content: \"\";\n",
       "    inset: 0;\n",
       "}\n",
       "\n",
       ".param-doc-description {\n",
       "    display: none;\n",
       "    position: absolute;\n",
       "    z-index: 9999;\n",
       "    left: 0;\n",
       "    padding: .5ex;\n",
       "    margin-left: 1.5em;\n",
       "    color: var(--sklearn-color-text);\n",
       "    box-shadow: .3em .3em .4em #999;\n",
       "    width: max-content;\n",
       "    text-align: left;\n",
       "    max-height: 10em;\n",
       "    overflow-y: auto;\n",
       "\n",
       "    /* unfitted */\n",
       "    background: var(--sklearn-color-unfitted-level-0);\n",
       "    border: thin solid var(--sklearn-color-unfitted-level-3);\n",
       "}\n",
       "\n",
       "@supports(position-area: center right) {\n",
       "    .param-doc-description {\n",
       "    position-area: center right;\n",
       "    position: fixed;\n",
       "    margin-left: 0;\n",
       "    }\n",
       "}\n",
       "\n",
       "/* Fitted state for parameter tooltips */\n",
       ".fitted .param-doc-description {\n",
       "    /* fitted */\n",
       "    background: var(--sklearn-color-fitted-level-0);\n",
       "    border: thin solid var(--sklearn-color-fitted-level-3);\n",
       "}\n",
       "\n",
       ".param-doc-link:hover .param-doc-description {\n",
       "    display: block;\n",
       "}\n",
       "\n",
       ".copy-paste-icon {\n",
       "    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNy4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjUgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTIwOCAwTDMzMi4xIDBjMTIuNyAwIDI0LjkgNS4xIDMzLjkgMTQuMWw2Ny45IDY3LjljOSA5IDE0LjEgMjEuMiAxNC4xIDMzLjlMNDQ4IDMzNmMwIDI2LjUtMjEuNSA0OC00OCA0OGwtMTkyIDBjLTI2LjUgMC00OC0yMS41LTQ4LTQ4bDAtMjg4YzAtMjYuNSAyMS41LTQ4IDQ4LTQ4ek00OCAxMjhsODAgMCAwIDY0LTY0IDAgMCAyNTYgMTkyIDAgMC0zMiA2NCAwIDAgNDhjMCAyNi41LTIxLjUgNDgtNDggNDhMNDggNTEyYy0yNi41IDAtNDgtMjEuNS00OC00OEwwIDE3NmMwLTI2LjUgMjEuNS00OCA0OC00OHoiLz48L3N2Zz4=);\n",
       "    background-repeat: no-repeat;\n",
       "    background-size: 14px 14px;\n",
       "    background-position: 0;\n",
       "    display: inline-block;\n",
       "    width: 14px;\n",
       "    height: 14px;\n",
       "    cursor: pointer;\n",
       "}\n",
       "\n",
       ".features {\n",
       "  font-family: monospace;\n",
       "  cursor: pointer;\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "  border: 1px dotted var(--sklearn-color-border-box);\n",
       "  border-radius: .20em;\n",
       "  margin-bottom: 0.5em;\n",
       "  font-size: inherit; /* Needed for jupyter */\n",
       "}\n",
       "\n",
       ".features.fitted {\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       ".features summary {\n",
       "  cursor: pointer;\n",
       "  display: flex;\n",
       "  margin-bottom: 0;\n",
       "  text-align: center;\n",
       "  align-items: center;\n",
       "  justify-content: center;\n",
       "  gap: 0.5em;\n",
       "  padding: .25em;\n",
       "}\n",
       "\n",
       ".features details[open] > summary {\n",
       "  color: var(--sklearn-color-text);\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "  border-radius: .20em 0 0 0;\n",
       "}\n",
       "\n",
       ".features.fitted details[open] > summary {\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "  border-radius: .20em 0 0 0;\n",
       "}\n",
       "\n",
       ".features details > summary .arrow::before {\n",
       "  content: \"▸\";\n",
       "  color: grey;\n",
       "}\n",
       "\n",
       ".features details[open] > summary .arrow::before {\n",
       "  content: \"▾\";\n",
       "}\n",
       "\n",
       ".features details:hover > summary {\n",
       "  margin: 0;\n",
       "  background-color: var(--sklearn-color-unfitted-level-2);\n",
       "}\n",
       "\n",
       ".features.fitted details:hover > summary {\n",
       "  margin: 0;\n",
       "  background-color: var(--sklearn-color-fitted-level-2);\n",
       "}\n",
       "\n",
       ".features .features-container {\n",
       "  max-width: 15em;\n",
       "  max-height: 10em;\n",
       "  overflow: auto;\n",
       "  scrollbar-width: thin;\n",
       "  padding: .25em 0.1rem;\n",
       "  background-color: var(--sklearn-color-unfitted-level-0);\n",
       "  border-radius: 0 0 .5em .5em;\n",
       "}\n",
       "\n",
       ".features.fitted .features-container {\n",
       "  background-color: var(--sklearn-color-fitted-level-0);\n",
       "}\n",
       "\n",
       ".features .image-container {\n",
       "  block-size: 1em;\n",
       "  inline-size: 1em;\n",
       "  padding: 0;\n",
       "  margin: 0%;\n",
       "  display: flex;\n",
       "  justify-content: center;\n",
       "  align-items: center;\n",
       "}\n",
       "\n",
       ".features .copy-paste-icon {\n",
       "  background-size: 1em 1em;\n",
       "  width: 1em;\n",
       "  height: 1em;\n",
       "  filter: grayscale(100%) opacity(60%);\n",
       "}\n",
       "\n",
       ".features .features-container table {\n",
       "  width: 100%;\n",
       "  margin: 0.01em;\n",
       "}\n",
       "\n",
       ".features .features-container table tr:nth-child(odd) {\n",
       "  background-color: #fff;\n",
       "}\n",
       "\n",
       ".features .features-container table tr:nth-child(even) {\n",
       "  background-color: #f6f6f6;\n",
       "}\n",
       "\n",
       ".features .features-container table tr:hover {\n",
       "  background-color: #e0e0e0;\n",
       "}\n",
       "\n",
       ".features .features-container table {\n",
       "  table-layout: inherit;\n",
       "}\n",
       "\n",
       ".features .features-container table td {\n",
       "  text-align: left;\n",
       "  padding: 0 0.5em;\n",
       "  border: 1px solid rgba(106, 105, 104, 0.232);\n",
       "  white-space: nowrap;\n",
       "  color: var(--sklearn-color-text);\n",
       "}\n",
       "\n",
       ".total_features {\n",
       "  display: flex;\n",
       "  justify-content: center;\n",
       "  margin-top: 0.5em;\n",
       "}\n",
       "</style><body><div id=\"sk-container-id-1\" tabindex=\"0\" class=\"sk-top-container sk-global\"><div class=\"sk-text-repr-fallback\"><pre>GridSearchCV(cv=5, estimator=SVC(kernel=&#x27;linear&#x27;), n_jobs=-1,\n",
       "             param_grid={&#x27;C&#x27;: [0.1, 1, 10, 100]}, scoring=&#x27;accuracy&#x27;)</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>GridSearchCV</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html\">?<span>Documentation for GridSearchCV</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"\">\n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Parameters</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('estimator',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-estimator;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=estimator,-estimator%20object\">\n",
       "            estimator\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-estimator;\">\n",
       "            estimator: estimator object<br><br>This is assumed to implement the scikit-learn estimator interface.<br>Either estimator needs to provide a ``score`` function,<br>or ``scoring`` must be passed.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">SVC(kernel=&#x27;linear&#x27;)</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('param_grid',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-param_grid;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=param_grid,-dict%20or%20list%20of%20dictionaries\">\n",
       "            param_grid\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-param_grid;\">\n",
       "            param_grid: dict or list of dictionaries<br><br>Dictionary with parameters names (`str`) as keys and lists of<br>parameter settings to try as values, or a list of such<br>dictionaries, in which case the grids spanned by each dictionary<br>in the list are explored. This enables searching over any sequence<br>of parameter settings.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">{&#x27;C&#x27;: [0.1, 1, ...]}</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('scoring',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-scoring;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=scoring,-str%2C%20callable%2C%20list%2C%20tuple%20or%20dict%2C%20default%3DNone\">\n",
       "            scoring\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-scoring;\">\n",
       "            scoring: str, callable, list, tuple or dict, default=None<br><br>Strategy to evaluate the performance of the cross-validated model on<br>the test set.<br><br>If `scoring` represents a single score, one can use:<br><br>- a single string (see :ref:`scoring_string_names`);<br>- a callable (see :ref:`scoring_callable`) that returns a single value;<br>- `None`, the `estimator`&#x27;s<br>  :ref:`default evaluation criterion &lt;scoring_api_overview&gt;` is used.<br><br>If `scoring` represents multiple scores, one can use:<br><br>- a list or tuple of unique strings;<br>- a callable returning a dictionary where the keys are the metric<br>  names and the values are the metric scores;<br>- a dictionary with metric names as keys and callables as values.<br><br>See :ref:`multimetric_grid_search` for an example.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;accuracy&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('n_jobs',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_jobs;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=n_jobs,-int%2C%20default%3DNone\">\n",
       "            n_jobs\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_jobs;\">\n",
       "            n_jobs: int, default=None<br><br>Number of jobs to run in parallel.<br>``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.<br>``-1`` means using all processors. See :term:`Glossary &lt;n_jobs&gt;`<br>for more details.<br><br>.. versionchanged:: v0.20<br>   `n_jobs` default changed from 1 to None</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">-1</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('cv',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-cv;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=cv,-int%2C%20cross-validation%20generator%20or%20an%20iterable%2C%20default%3DNone\">\n",
       "            cv\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-cv;\">\n",
       "            cv: int, cross-validation generator or an iterable, default=None<br><br>Determines the cross-validation splitting strategy.<br>Possible inputs for cv are:<br><br>- None, to use the default 5-fold cross validation,<br>- integer, to specify the number of folds in a `(Stratified)KFold`,<br>- :term:`CV splitter`,<br>- an iterable yielding (train, test) splits as arrays of indices.<br><br>For integer/None inputs, if the estimator is a classifier and ``y`` is<br>either binary or multiclass, :class:`StratifiedKFold` is used. In all<br>other cases, :class:`KFold` is used. These splitters are instantiated<br>with `shuffle=False` so the splits will be the same across calls.<br><br>Refer :ref:`User Guide &lt;cross_validation&gt;` for the various<br>cross-validation strategies that can be used here.<br><br>.. versionchanged:: 0.22<br>    ``cv`` default value if None changed from 3-fold to 5-fold.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">5</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('refit',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-refit;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=refit,-bool%2C%20str%2C%20or%20callable%2C%20default%3DTrue\">\n",
       "            refit\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-refit;\">\n",
       "            refit: bool, str, or callable, default=True<br><br>Refit an estimator using the best found parameters on the whole<br>dataset.<br><br>For multiple metric evaluation, this needs to be a `str` denoting the<br>scorer that would be used to find the best parameters for refitting<br>the estimator at the end.<br><br>Where there are considerations other than maximum score in<br>choosing a best estimator, ``refit`` can be set to a function which<br>returns the selected ``best_index_`` given ``cv_results_``. In that<br>case, the ``best_estimator_`` and ``best_params_`` will be set<br>according to the returned ``best_index_`` while the ``best_score_``<br>attribute will not be available.<br><br>The refitted estimator is made available at the ``best_estimator_``<br>attribute and permits using ``predict`` directly on this<br>``GridSearchCV`` instance.<br><br>Also for multiple metric evaluation, the attributes ``best_index_``,<br>``best_score_`` and ``best_params_`` will only be available if<br>``refit`` is set and all of them will be determined w.r.t this specific<br>scorer.<br><br>See ``scoring`` parameter to know more about multiple metric<br>evaluation.<br><br>See :ref:`sphx_glr_auto_examples_model_selection_plot_grid_search_digits.py`<br>to see how to design a custom selection strategy using a callable<br>via `refit`.<br><br>See :ref:`this example<br>&lt;sphx_glr_auto_examples_model_selection_plot_grid_search_refit_callable.py&gt;`<br>for an example of how to use ``refit=callable`` to balance model<br>complexity and cross-validated score.<br><br>.. versionchanged:: 0.20<br>    Support for callable added.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('verbose',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-verbose;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=verbose,-int%2C%20default%3D0\">\n",
       "            verbose\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-verbose;\">\n",
       "            verbose: int, default=0<br><br>Controls the verbosity of information printed during fitting, with higher<br>values yielding more detailed logging.<br><br>- 0 : no messages are printed;<br>- &gt;=1 : summary of the total number of fits;<br>- &gt;=2 : computation time for each fold and parameter candidate;<br>- &gt;=3 : fold indices and scores;<br>- &gt;=10 : parameter candidate indices and START messages before each fit.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('pre_dispatch',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-pre_dispatch;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=pre_dispatch,-int%2C%20or%20str%2C%20default%3D%272%2An_jobs%27\">\n",
       "            pre_dispatch\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-pre_dispatch;\">\n",
       "            pre_dispatch: int, or str, default=&#x27;2*n_jobs&#x27;<br><br>Controls the number of jobs that get dispatched during parallel<br>execution. Reducing this number can be useful to avoid an<br>explosion of memory consumption when more jobs get dispatched<br>than CPUs can process. This parameter can be:<br><br>- None, in which case all the jobs are immediately created and spawned. Use<br>  this for lightweight and fast-running jobs, to avoid delays due to on-demand<br>  spawning of the jobs<br>- An int, giving the exact number of total jobs that are spawned<br>- A str, giving an expression as a function of n_jobs, as in &#x27;2*n_jobs&#x27;</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;2*n_jobs&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('error_score',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-error_score;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=error_score,-%27raise%27%20or%20numeric%2C%20default%3Dnp.nan\">\n",
       "            error_score\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-error_score;\">\n",
       "            error_score: &#x27;raise&#x27; or numeric, default=np.nan<br><br>Value to assign to the score if an error occurs in estimator fitting.<br>If set to &#x27;raise&#x27;, the error is raised. If a numeric value is given,<br>FitFailedWarning is raised. This parameter does not affect the refit<br>step, which will always raise the error.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">nan</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('return_train_score',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-return_train_score;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=return_train_score,-bool%2C%20default%3DFalse\">\n",
       "            return_train_score\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-return_train_score;\">\n",
       "            return_train_score: bool, default=False<br><br>If ``False``, the ``cv_results_`` attribute will not include training<br>scores.<br>Computing training scores is used to get insights on how different<br>parameter settings impact the overfitting/underfitting trade-off.<br>However computing the scores on the training set can be computationally<br>expensive and is not strictly required to select the parameters that<br>yield the best generalization performance.<br><br>.. versionadded:: 0.19<br><br>.. versionchanged:: 0.21<br>    Default value was changed from ``True`` to ``False``</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    \n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Fitted attributes</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                    <tbody>\n",
       "                        <tr>\n",
       "                        <th>Name</th>\n",
       "                        <th>Type</th>\n",
       "                        <th>Value</th>\n",
       "                        </tr>\n",
       "                        \n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-best_estimator_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=best_estimator_,-estimator\">\n",
       "            best_estimator_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-best_estimator_;\">\n",
       "            best_estimator_: estimator<br><br>Estimator that was chosen by the search, i.e. estimator<br>which gave highest score (or smallest loss if specified)<br>on the left out data. Not available if ``refit=False``.<br><br>See ``refit`` parameter for more information on allowed values.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">SVC</td>\n",
       "           <td>SVC(C=0.1, kernel=&#x27;linear&#x27;)</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-best_index_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=best_index_,-int\">\n",
       "            best_index_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-best_index_;\">\n",
       "            best_index_: int<br><br>The index (of the ``cv_results_`` arrays) which corresponds to the best<br>candidate parameter setting.<br><br>The dict at ``search.cv_results_[&#x27;params&#x27;][search.best_index_]`` gives<br>the parameter setting for the best model, that gives the highest<br>mean score (``search.best_score_``).<br><br>For multi-metric evaluation, this is present only if ``refit`` is<br>specified.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int64</td>\n",
       "           <td>np.int64(0)</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-best_params_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=best_params_,-dict\">\n",
       "            best_params_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-best_params_;\">\n",
       "            best_params_: dict<br><br>Parameter setting that gave the best results on the hold out data.<br><br>For multi-metric evaluation, this is present only if ``refit`` is<br>specified.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">dict</td>\n",
       "           <td>{&#x27;C&#x27;: 0.1}</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-best_score_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=best_score_,-float\">\n",
       "            best_score_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-best_score_;\">\n",
       "            best_score_: float<br><br>Mean cross-validated score of the best_estimator<br><br>For multi-metric evaluation, this is present only if ``refit`` is<br>specified.<br><br>This attribute is not available if ``refit`` is a function.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">float64</td>\n",
       "           <td>0.9132</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-classes_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=classes_,-ndarray%20of%20shape%20%28n_classes%2C%29\">\n",
       "            classes_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-classes_;\">\n",
       "            classes_: ndarray of shape (n_classes,)<br><br>The classes labels. This is present only if ``refit`` is specified and<br>the underlying estimator is a classifier.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[uint8](10,)</td>\n",
       "           <td>[0,1,2,...,7,8,9]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-cv_results_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=cv_results_,-dict%20of%20numpy%20%28masked%29%20ndarrays\">\n",
       "            cv_results_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-cv_results_;\">\n",
       "            cv_results_: dict of numpy (masked) ndarrays<br><br>A dict with keys as column headers and values as columns, that can be<br>imported into a pandas ``DataFrame``.<br><br>For instance the below given table<br><br>+------------+-----------+------------+-----------------+---+---------+<br>|param_kernel|param_gamma|param_degree|split0_test_score|...|rank_t...|<br>+============+===========+============+=================+===+=========+<br>|  &#x27;poly&#x27;    |     --    |      2     |       0.80      |...|    2    |<br>+------------+-----------+------------+-----------------+---+---------+<br>|  &#x27;poly&#x27;    |     --    |      3     |       0.70      |...|    4    |<br>+------------+-----------+------------+-----------------+---+---------+<br>|  &#x27;rbf&#x27;     |     0.1   |     --     |       0.80      |...|    3    |<br>+------------+-----------+------------+-----------------+---+---------+<br>|  &#x27;rbf&#x27;     |     0.2   |     --     |       0.93      |...|    1    |<br>+------------+-----------+------------+-----------------+---+---------+<br><br>will be represented by a ``cv_results_`` dict of::<br><br>    {<br>    &#x27;param_kernel&#x27;: masked_array(data = [&#x27;poly&#x27;, &#x27;poly&#x27;, &#x27;rbf&#x27;, &#x27;rbf&#x27;],<br>                                 mask = [False False False False]...)<br>    &#x27;param_gamma&#x27;: masked_array(data = [-- -- 0.1 0.2],<br>                                mask = [ True  True False False]...),<br>    &#x27;param_degree&#x27;: masked_array(data = [2.0 3.0 -- --],<br>                                 mask = [False False  True  True]...),<br>    &#x27;split0_test_score&#x27;  : [0.80, 0.70, 0.80, 0.93],<br>    &#x27;split1_test_score&#x27;  : [0.82, 0.50, 0.70, 0.78],<br>    &#x27;mean_test_score&#x27;    : [0.81, 0.60, 0.75, 0.85],<br>    &#x27;std_test_score&#x27;     : [0.01, 0.10, 0.05, 0.08],<br>    &#x27;rank_test_score&#x27;    : [2, 4, 3, 1],<br>    &#x27;split0_train_score&#x27; : [0.80, 0.92, 0.70, 0.93],<br>    &#x27;split1_train_score&#x27; : [0.82, 0.55, 0.70, 0.87],<br>    &#x27;mean_train_score&#x27;   : [0.81, 0.74, 0.70, 0.90],<br>    &#x27;std_train_score&#x27;    : [0.01, 0.19, 0.00, 0.03],<br>    &#x27;mean_fit_time&#x27;      : [0.73, 0.63, 0.43, 0.49],<br>    &#x27;std_fit_time&#x27;       : [0.01, 0.02, 0.01, 0.01],<br>    &#x27;mean_score_time&#x27;    : [0.01, 0.06, 0.04, 0.04],<br>    &#x27;std_score_time&#x27;     : [0.00, 0.00, 0.00, 0.01],<br>    &#x27;params&#x27;             : [{&#x27;kernel&#x27;: &#x27;poly&#x27;, &#x27;degree&#x27;: 2}, ...],<br>    }<br><br>For an example of visualization and interpretation of GridSearch results,<br>see :ref:`sphx_glr_auto_examples_model_selection_plot_grid_search_stats.py`.<br><br>NOTE<br><br>The key ``&#x27;params&#x27;`` is used to store a list of parameter<br>settings dicts for all the parameter candidates.<br><br>The ``mean_fit_time``, ``std_fit_time``, ``mean_score_time`` and<br>``std_score_time`` are all in seconds.<br><br>For multi-metric evaluation, the scores for all the scorers are<br>available in the ``cv_results_`` dict at the keys ending with that<br>scorer&#x27;s name (``&#x27;_&lt;scorer_name&gt;&#x27;``) instead of ``&#x27;_score&#x27;`` shown<br>above. (&#x27;split0_test_precision&#x27;, &#x27;mean_train_precision&#x27; etc.)</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">dict</td>\n",
       "           <td>{&#x27;me...me&#x27;: array([2.9300..., 3.11562152]), &#x27;me...me&#x27;: array([1.6206..., 1.38809972]), &#x27;me...re&#x27;: array([0.9132...9026, 0.9026]), &#x27;param_C&#x27;: masked_array(...l_value=1e+20), ...}</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-multimetric_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=multimetric_,-bool\">\n",
       "            multimetric_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-multimetric_;\">\n",
       "            multimetric_: bool<br><br>Whether or not the scorers compute several metrics.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">bool</td>\n",
       "           <td>False</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_features_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=n_features_in_,-int\">\n",
       "            n_features_in_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_features_in_;\">\n",
       "            n_features_in_: int<br><br>Number of features seen during :term:`fit`. Only defined if<br>`best_estimator_` is defined (see the documentation for the `refit`<br>parameter for more details) and that `best_estimator_` exposes<br>`n_features_in_` when fit.<br><br>.. versionadded:: 0.24</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>784</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_splits_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=n_splits_,-int\">\n",
       "            n_splits_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_splits_;\">\n",
       "            n_splits_: int<br><br>The number of cross-validation splits (folds/iterations).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>5</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-refit_time_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=refit_time_,-float\">\n",
       "            refit_time_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-refit_time_;\">\n",
       "            refit_time_: float<br><br>Seconds used for refitting the best model on the whole dataset.<br><br>This is present only if ``refit`` is not False.<br><br>.. versionadded:: 0.20</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">float</td>\n",
       "           <td>1.713</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-scorer_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.model_selection.GridSearchCV.html#:~:text=scorer_,-function%20or%20a%20dict\">\n",
       "            scorer_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-scorer_;\">\n",
       "            scorer_: function or a dict<br><br>Scorer function used on the held out data to choose the best<br>parameters for the model.<br><br>For multi-metric evaluation, this attribute holds the validated<br>``scoring`` dict which maps the scorer key to the scorer callable.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">_Scorer</td>\n",
       "           <td>make_scorer(a...hod=&#x27;predict&#x27;)</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>best_estimator_: SVC</div></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"best_estimator___\"><pre>SVC(C=0.1, kernel=&#x27;linear&#x27;)</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>SVC</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html\">?<span>Documentation for SVC</span></a></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"best_estimator___\">\n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Parameters</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('C',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-C;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=C,-float%2C%20default%3D1.0\">\n",
       "            C\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-C;\">\n",
       "            C: float, default=1.0<br><br>Regularization parameter. The strength of the regularization is<br>inversely proportional to C. Must be strictly positive. The penalty<br>is a squared l2 penalty. For an intuitive visualization of the effects<br>of scaling the regularization parameter C, see<br>:ref:`sphx_glr_auto_examples_svm_plot_svm_scale_c.py`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0.1</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('kernel',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-kernel;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=kernel,-%7B%27linear%27%2C%20%27poly%27%2C%20%27rbf%27%2C%20%27sigmoid%27%2C%20%27precomputed%27%7D%20or%20callable%2C%20%20%20%20%20%20%20%20%20%20default%3D%27rbf%27\">\n",
       "            kernel\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-kernel;\">\n",
       "            kernel: {&#x27;linear&#x27;, &#x27;poly&#x27;, &#x27;rbf&#x27;, &#x27;sigmoid&#x27;, &#x27;precomputed&#x27;} or callable,          default=&#x27;rbf&#x27;<br><br>Specifies the kernel type to be used in the algorithm. If<br>none is given, &#x27;rbf&#x27; will be used. If a callable is given it is used to<br>pre-compute the kernel matrix from data matrices; that matrix should be<br>an array of shape ``(n_samples, n_samples)``. For an intuitive<br>visualization of different kernel types see<br>:ref:`sphx_glr_auto_examples_svm_plot_svm_kernels.py`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;linear&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('degree',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-degree;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=degree,-int%2C%20default%3D3\">\n",
       "            degree\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-degree;\">\n",
       "            degree: int, default=3<br><br>Degree of the polynomial kernel function (&#x27;poly&#x27;).<br>Must be non-negative. Ignored by all other kernels.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">3</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('gamma',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-gamma;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=gamma,-%7B%27scale%27%2C%20%27auto%27%7D%20or%20float%2C%20default%3D%27scale%27\">\n",
       "            gamma\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-gamma;\">\n",
       "            gamma: {&#x27;scale&#x27;, &#x27;auto&#x27;} or float, default=&#x27;scale&#x27;<br><br>Kernel coefficient for &#x27;rbf&#x27;, &#x27;poly&#x27; and &#x27;sigmoid&#x27;.<br><br>- if ``gamma=&#x27;scale&#x27;`` (default) is passed then it uses<br>  1 / (n_features * X.var()) as value of gamma,<br>- if &#x27;auto&#x27;, uses 1 / n_features<br>- if float, must be non-negative.<br><br>.. versionchanged:: 0.22<br>   The default value of ``gamma`` changed from &#x27;auto&#x27; to &#x27;scale&#x27;.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;scale&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('coef0',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-coef0;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=coef0,-float%2C%20default%3D0.0\">\n",
       "            coef0\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-coef0;\">\n",
       "            coef0: float, default=0.0<br><br>Independent term in kernel function.<br>It is only significant in &#x27;poly&#x27; and &#x27;sigmoid&#x27;.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0.0</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('shrinking',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-shrinking;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=shrinking,-bool%2C%20default%3DTrue\">\n",
       "            shrinking\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-shrinking;\">\n",
       "            shrinking: bool, default=True<br><br>Whether to use the shrinking heuristic.<br>See the :ref:`User Guide &lt;shrinking_svm&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('probability',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-probability;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=probability,-bool%2C%20default%3DFalse\">\n",
       "            probability\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-probability;\">\n",
       "            probability: bool, default=False<br><br>Whether to enable probability estimates. This must be enabled prior<br>to calling `fit`, will slow down that method as it internally uses<br>5-fold cross-validation, and `predict_proba` may be inconsistent with<br>`predict`. Read more in the :ref:`User Guide &lt;scores_probabilities&gt;`.<br><br>..deprecated:: 1.9<br>  The `probability` parameter is deprecated and will be removed in 1.11.<br>  Use `CalibratedClassifierCV(SVC(), ensemble=False)` instead of<br>  `SVC(probability=True)`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;deprecated&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('tol',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-tol;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=tol,-float%2C%20default%3D1e-3\">\n",
       "            tol\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-tol;\">\n",
       "            tol: float, default=1e-3<br><br>Tolerance for stopping criterion.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0.001</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('cache_size',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-cache_size;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=cache_size,-float%2C%20default%3D200\">\n",
       "            cache_size\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-cache_size;\">\n",
       "            cache_size: float, default=200<br><br>Specify the size of the kernel cache (in MB).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">200</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('class_weight',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-class_weight;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=class_weight,-dict%20or%20%27balanced%27%2C%20default%3DNone\">\n",
       "            class_weight\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-class_weight;\">\n",
       "            class_weight: dict or &#x27;balanced&#x27;, default=None<br><br>Set the parameter C of class i to class_weight[i]*C for<br>SVC. If not given, all classes are supposed to have<br>weight one.<br>The &quot;balanced&quot; mode uses the values of y to automatically adjust<br>weights inversely proportional to class frequencies in the input data<br>as ``n_samples / (n_classes * np.bincount(y))``.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('verbose',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-verbose;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=verbose,-bool%2C%20default%3DFalse\">\n",
       "            verbose\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-verbose;\">\n",
       "            verbose: bool, default=False<br><br>Enable verbose output. Note that this setting takes advantage of a<br>per-process runtime setting in libsvm that, if enabled, may not work<br>properly in a multithreaded context.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('max_iter',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-max_iter;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=max_iter,-int%2C%20default%3D-1\">\n",
       "            max_iter\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-max_iter;\">\n",
       "            max_iter: int, default=-1<br><br>Hard limit on iterations within solver, or -1 for no limit.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">-1</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('decision_function_shape',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-decision_function_shape;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=decision_function_shape,-%7B%27ovo%27%2C%20%27ovr%27%7D%2C%20default%3D%27ovr%27\">\n",
       "            decision_function_shape\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-decision_function_shape;\">\n",
       "            decision_function_shape: {&#x27;ovo&#x27;, &#x27;ovr&#x27;}, default=&#x27;ovr&#x27;<br><br>Whether to return a one-vs-rest (&#x27;ovr&#x27;) decision function of shape<br>(n_samples, n_classes) as all other classifiers, or the original<br>one-vs-one (&#x27;ovo&#x27;) decision function of libsvm which has shape<br>(n_samples, n_classes * (n_classes - 1) / 2). However, note that<br>internally, one-vs-one (&#x27;ovo&#x27;) is always used as a multi-class strategy<br>to train models; an ovr matrix is only constructed from the ovo matrix.<br>The parameter is ignored for binary classification.<br><br>.. versionchanged:: 0.19<br>    decision_function_shape is &#x27;ovr&#x27; by default.<br><br>.. versionadded:: 0.17<br>   *decision_function_shape=&#x27;ovr&#x27;* is recommended.<br><br>.. versionchanged:: 0.17<br>   Deprecated *decision_function_shape=&#x27;ovo&#x27; and None*.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;ovr&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('break_ties',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-break_ties;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=break_ties,-bool%2C%20default%3DFalse\">\n",
       "            break_ties\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-break_ties;\">\n",
       "            break_ties: bool, default=False<br><br>If true, ``decision_function_shape=&#x27;ovr&#x27;``, and number of classes &gt; 2,<br>:term:`predict` will break ties according to the confidence values of<br>:term:`decision_function`; otherwise the first class among the tied<br>classes is returned. Please note that breaking ties comes at a<br>relatively high computational cost compared to a simple predict. See<br>:ref:`sphx_glr_auto_examples_svm_plot_svm_tie_breaking.py` for an<br>example of its usage with ``decision_function_shape=&#x27;ovr&#x27;``.<br><br>.. versionadded:: 0.22</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><i class=\"copy-paste-icon\"\n",
       "                 onclick=\"copyToClipboard('random_state',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></i></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-random_state;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=random_state,-int%2C%20RandomState%20instance%20or%20None%2C%20default%3DNone\">\n",
       "            random_state\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-random_state;\">\n",
       "            random_state: int, RandomState instance or None, default=None<br><br>Controls the pseudo random number generation for shuffling the data for<br>probability estimates. Ignored when `probability` is False.<br>Pass an int for reproducible output across multiple function calls.<br>See :term:`Glossary &lt;random_state&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    \n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Fitted attributes</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                    <tbody>\n",
       "                        <tr>\n",
       "                        <th>Name</th>\n",
       "                        <th>Type</th>\n",
       "                        <th>Value</th>\n",
       "                        </tr>\n",
       "                        \n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-class_weight_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=class_weight_,-ndarray%20of%20shape%20%28n_classes%2C%29\">\n",
       "            class_weight_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-class_weight_;\">\n",
       "            class_weight_: ndarray of shape (n_classes,)<br><br>Multipliers of parameter C for each class.<br>Computed based on the ``class_weight`` parameter.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](10,)</td>\n",
       "           <td>[1.,1.,1.,...,1.,1.,1.]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-classes_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=classes_,-ndarray%20of%20shape%20%28n_classes%2C%29\">\n",
       "            classes_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-classes_;\">\n",
       "            classes_: ndarray of shape (n_classes,)<br><br>The classes labels.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[uint8](10,)</td>\n",
       "           <td>[0,1,2,...,7,8,9]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-coef_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=coef_,-ndarray%20or%20sparse%20array/matrix%20%20%20%20%20%20%20%20%20%20%20%20%20of%20shape%20%28n_classes%20%2A%20%28n_classes%20-%201%29%20/%202%2C%20n_features%29\">\n",
       "            coef_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-coef_;\">\n",
       "            coef_: ndarray or sparse array/matrix             of shape (n_classes * (n_classes - 1) / 2, n_features)<br><br>Weights assigned to the features (coefficients in the primal<br>problem). This is only available in the case of a linear kernel.<br><br>`coef_` is a readonly property derived from `dual_coef_` and<br>`support_vectors_`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](45, 784)</td>\n",
       "           <td>[[0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " ...,\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.]]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-dual_coef_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=dual_coef_,-ndarray%20or%20sparse%20array/matrix%20of%20shape%20%28n_classes%20-1%2C%20n_SV%29\">\n",
       "            dual_coef_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-dual_coef_;\">\n",
       "            dual_coef_: ndarray or sparse array/matrix of shape (n_classes -1, n_SV)<br><br>Dual coefficients of the support vector in the decision<br>function (see :ref:`sgd_mathematical_formulation`), multiplied by<br>their targets.<br>For multiclass, coefficient for all 1-vs-1 classifiers.<br>The layout of the coefficients in the multiclass case is somewhat<br>non-trivial. See the :ref:`multi-class section of the User Guide<br>&lt;svm_multi_class&gt;` for details.<br>If `X` is sparse, these will also be sparse.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](9, 1842)</td>\n",
       "           <td>[[ 0.  , 0.  , 0.  ,...,-0.  ,-0.  ,-0.1 ],\n",
       " [ 0.05, 0.03, 0.  ,...,-0.  ,-0.1 ,-0.  ],\n",
       " [ 0.04, 0.01, 0.03,...,-0.  ,-0.1 ,-0.  ],\n",
       " ...,\n",
       " [ 0.  , 0.  , 0.  ,...,-0.  ,-0.05,-0.  ],\n",
       " [ 0.  , 0.1 , 0.  ,...,-0.  ,-0.1 ,-0.1 ],\n",
       " [ 0.  , 0.  , 0.  ,...,-0.  ,-0.02,-0.04]]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-fit_status_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=fit_status_,-int\">\n",
       "            fit_status_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-fit_status_;\">\n",
       "            fit_status_: int<br><br>0 if correctly fitted, 1 otherwise (will raise warning)</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>0</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-intercept_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=intercept_,-ndarray%20of%20shape%20%28n_classes%20%2A%20%28n_classes%20-%201%29%20/%202%2C%29\">\n",
       "            intercept_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-intercept_;\">\n",
       "            intercept_: ndarray of shape (n_classes * (n_classes - 1) / 2,)<br><br>Constants in decision function.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](45,)</td>\n",
       "           <td>[-0.44,-0.08, 0.02,..., 1.62, 0.84,-1.86]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_features_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=n_features_in_,-int\">\n",
       "            n_features_in_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_features_in_;\">\n",
       "            n_features_in_: int<br><br>Number of features seen during :term:`fit`.<br><br>.. versionadded:: 0.24</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>784</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_iter_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=n_iter_,-ndarray%20of%20shape%20%28n_classes%20%2A%20%28n_classes%20-%201%29%20//%202%2C%29\">\n",
       "            n_iter_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_iter_;\">\n",
       "            n_iter_: ndarray of shape (n_classes * (n_classes - 1) // 2,)<br><br>Number of iterations run by the optimization routine to fit the model.<br>The shape of this attribute depends on the number of models optimized<br>which in turn depends on the number of classes.<br><br>.. versionadded:: 1.1</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[int32](45,)</td>\n",
       "           <td>[ 193, 490, 614,..., 523,1523, 940]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-n_support_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=n_support_,-ndarray%20of%20shape%20%28n_classes%2C%29%2C%20dtype%3Dint32\">\n",
       "            n_support_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_support_;\">\n",
       "            n_support_: ndarray of shape (n_classes,), dtype=int32<br><br>Number of support vectors for each class.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[int32](10,)</td>\n",
       "           <td>[110,108,183,...,181,243,230]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-probA_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=probA_,-ndarray%20of%20shape%20%28n_classes%20%2A%20%28n_classes%20-%201%29%20/%202%29\">\n",
       "            probA_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-probA_;\">\n",
       "            probA_: ndarray of shape (n_classes * (n_classes - 1) / 2)<br><br>If `probability=True`, it corresponds to the parameters learned in<br>Platt scaling to produce probability estimates from decision values.<br>If `probability=False`, it&#x27;s an empty array. Platt scaling uses the<br>logistic function</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](0,)</td>\n",
       "           <td>[]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-probB_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=probB_,-ndarray%20of%20shape%20%28n_classes%20%2A%20%28n_classes%20-%201%29%20/%202%29\">\n",
       "            probB_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-probB_;\">\n",
       "            probB_: ndarray of shape (n_classes * (n_classes - 1) / 2)<br><br>If `probability=True`, it corresponds to the parameters learned in<br>Platt scaling. Platt scaling uses the logistic function<br>``1 / (1 + exp(decision_value * probA_ + probB_))``<br>where ``probA_`` and ``probB_`` are learned from the dataset [2]_. For<br>more information on the multiclass case and training procedure see<br>section 8 of [1]_.<br><br>.. deprecated:: 1.9<br>    The attributes `probA_` and `probB_` are deprecated in version 1.9 and will<br>    be removed in 1.11.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](0,)</td>\n",
       "           <td>[]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-shape_fit_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=shape_fit_,-tuple%20of%20int%20of%20shape%20%28n_dimensions_of_X%2C%29\">\n",
       "            shape_fit_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-shape_fit_;\">\n",
       "            shape_fit_: tuple of int of shape (n_dimensions_of_X,)<br><br>Array dimensions of training vector ``X``.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">tuple</td>\n",
       "           <td>(5000, 784)</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-support_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=support_,-ndarray%20of%20shape%20%28n_SV%29\">\n",
       "            support_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-support_;\">\n",
       "            support_: ndarray of shape (n_SV)<br><br>Indices of support vectors.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[int32](1842,)</td>\n",
       "           <td>[  52,  62,  88,...,4942,4963,4996]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "\n",
       "       <tr class=\"default\">\n",
       "           <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-support_vectors_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.svm.SVC.html#:~:text=support_vectors_,-ndarray%20or%20sparse%20array/matrix%20of%20shape%20%28n_SV%2C%20n_features%29\">\n",
       "            support_vectors_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-support_vectors_;\">\n",
       "            support_vectors_: ndarray or sparse array/matrix of shape (n_SV, n_features)<br><br>Support vectors. An empty array if kernel is precomputed.<br>If `X` is sparse, these will also be sparse.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](1842, 784)</td>\n",
       "           <td>[[0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " ...,\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.],\n",
       " [0.,0.,0.,...,0.,0.,0.]]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div></div></div></div></div></div></div></div><script>/*  Authors: The scikit-learn developers\n",
       " SPDX-License-Identifier: BSD-3-Clause\n",
       "*/\n",
       "\n",
       "function copyToClipboard(text, element) {\n",
       "    // Get the parameter prefix from the closest toggleable content\n",
       "    const toggleableContent = element.closest('.sk-toggleable__content');\n",
       "    const paramPrefix = toggleableContent ? toggleableContent.dataset.paramPrefix : '';\n",
       "    const fullParamName = paramPrefix ? `${paramPrefix}${text}` : text;\n",
       "\n",
       "    const originalStyle = element.style;\n",
       "    const computedStyle = window.getComputedStyle(element);\n",
       "    const originalWidth = computedStyle.width;\n",
       "    const originalHTML = element.innerHTML.replace('Copied!', '');\n",
       "\n",
       "    navigator.clipboard.writeText(fullParamName)\n",
       "        .then(() => {\n",
       "            element.style.width = originalWidth;\n",
       "            element.style.color = 'green';\n",
       "            element.innerHTML = \"Copied!\";\n",
       "\n",
       "            setTimeout(() => {\n",
       "                element.innerHTML = originalHTML;\n",
       "                element.style = originalStyle;\n",
       "            }, 2000);\n",
       "        })\n",
       "        .catch(err => {\n",
       "            console.error('Failed to copy:', err);\n",
       "            element.style.color = 'red';\n",
       "            element.innerHTML = \"Failed!\";\n",
       "            setTimeout(() => {\n",
       "                element.innerHTML = originalHTML;\n",
       "                element.style = originalStyle;\n",
       "            }, 2000);\n",
       "        });\n",
       "    return false;\n",
       "}\n",
       "\n",
       "document.querySelectorAll('.copy-paste-icon').forEach(function(element) {\n",
       "    const toggleableContent = element.closest('.sk-toggleable__content');\n",
       "    const paramPrefix = toggleableContent ? toggleableContent.dataset.paramPrefix : '';\n",
       "\n",
       "    const parent = element.parentElement;\n",
       "    if (!parent || !parent.nextElementSibling) {\n",
       "        console.warn('Expected copy-paste icon is missing from the DOM structure');\n",
       "        return;\n",
       "    }\n",
       "\n",
       "    const paramName = element.parentElement.nextElementSibling\n",
       "        .textContent.trim().split(' ')[0];\n",
       "    const fullParamName = paramPrefix ? `${paramPrefix}${paramName}` : paramName;\n",
       "\n",
       "    element.setAttribute('title', fullParamName);\n",
       "});\n",
       "\n",
       "/**\n",
       " * Copy the list of feature names formatted as a Python list.\n",
       " *\n",
       " * @param {HTMLElement} element - The copy button inside a `.features` block; its siblings\n",
       " *   contain a `details` element and a table containing feature named.\n",
       " * @returns {boolean} Always returns `false` so callers can prevent the default click behavior.\n",
       " */\n",
       "function copyFeatureNamesToClipboard(element) {\n",
       "    var detailsElem = element.closest('.features').querySelector('details');\n",
       "    var wasOpen = detailsElem.open;\n",
       "    detailsElem.open = true;\n",
       "    var content = element.closest('.features').querySelector('tbody')\n",
       "                  .innerText.trim();\n",
       "    if (!wasOpen) detailsElem.open = false;\n",
       "    const rows = content.split('\\n').map(row => `    \"${row}\"`);\n",
       "    const formattedText = `[\\n${rows.join(',\\n')},\\n]`;\n",
       "    const originalHTML = element.innerHTML.replace('✔', '');\n",
       "    const originalStyle = element.style;\n",
       "    const copyMark = document.createElement('span');\n",
       "    copyMark.innerHTML = '✔';\n",
       "    copyMark.style.color = 'blue';\n",
       "    copyMark.style.fontSize = '1em';\n",
       "\n",
       "    navigator.clipboard.writeText(formattedText)\n",
       "        .then(() => {\n",
       "            element.style.display = 'none';\n",
       "            element.parentElement.appendChild(copyMark);\n",
       "\n",
       "            setTimeout(() => {\n",
       "                copyMark.remove();\n",
       "                element.innerHTML = originalHTML;\n",
       "                element.style = originalStyle;\n",
       "            }, 1000);\n",
       "        })\n",
       "        .catch(err => {\n",
       "            console.error('Failed to copy:', err);\n",
       "            element.style.color = 'orange';\n",
       "            element.innerHTML = \"Failed!\";\n",
       "            setTimeout(() => {\n",
       "                element.innerHTML = originalHTML;\n",
       "                element.style = originalStyle;\n",
       "            }, 1000);\n",
       "        });\n",
       "    return false;\n",
       "}\n",
       "/**\n",
       " * Adapted from Skrub\n",
       " * https://github.com/skrub-data/skrub/blob/403466d1d5d4dc76a7ef569b3f8228db59a31dc3/skrub/_reporting/_data/templates/report.js#L789\n",
       " * @returns \"light\" or \"dark\"\n",
       " */\n",
       "function detectTheme(element) {\n",
       "    const body = document.querySelector('body');\n",
       "\n",
       "    // Check VSCode theme\n",
       "    const themeKindAttr = body.getAttribute('data-vscode-theme-kind');\n",
       "    const themeNameAttr = body.getAttribute('data-vscode-theme-name');\n",
       "\n",
       "    if (themeKindAttr && themeNameAttr) {\n",
       "        const themeKind = themeKindAttr.toLowerCase();\n",
       "        const themeName = themeNameAttr.toLowerCase();\n",
       "\n",
       "        if (themeKind.includes(\"dark\") || themeName.includes(\"dark\")) {\n",
       "            return \"dark\";\n",
       "        }\n",
       "        if (themeKind.includes(\"light\") || themeName.includes(\"light\")) {\n",
       "            return \"light\";\n",
       "        }\n",
       "    }\n",
       "\n",
       "    // Check Jupyter theme\n",
       "    if (body.getAttribute('data-jp-theme-light') === 'false') {\n",
       "        return 'dark';\n",
       "    } else if (body.getAttribute('data-jp-theme-light') === 'true') {\n",
       "        return 'light';\n",
       "    }\n",
       "\n",
       "    // Guess based on a parent element's color\n",
       "    const color = window.getComputedStyle(element.parentNode, null).getPropertyValue('color');\n",
       "    const match = color.match(/^rgb\\s*\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)\\s*$/i);\n",
       "    if (match) {\n",
       "        const [r, g, b] = [\n",
       "            parseFloat(match[1]),\n",
       "            parseFloat(match[2]),\n",
       "            parseFloat(match[3])\n",
       "        ];\n",
       "\n",
       "        // https://en.wikipedia.org/wiki/HSL_and_HSV#Lightness\n",
       "        const luma = 0.299 * r + 0.587 * g + 0.114 * b;\n",
       "\n",
       "        if (luma > 180) {\n",
       "            // If the text is very bright we have a dark theme\n",
       "            return 'dark';\n",
       "        }\n",
       "        if (luma < 75) {\n",
       "            // If the text is very dark we have a light theme\n",
       "            return 'light';\n",
       "        }\n",
       "        // Otherwise fall back to the next heuristic.\n",
       "    }\n",
       "\n",
       "    // Fallback to system preference\n",
       "    return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n",
       "}\n",
       "\n",
       "\n",
       "function forceTheme(elementId) {\n",
       "    const estimatorElement = document.querySelector(`#${elementId}`);\n",
       "    if (estimatorElement === null) {\n",
       "        console.error(`Element with id ${elementId} not found.`);\n",
       "    } else {\n",
       "        const theme = detectTheme(estimatorElement);\n",
       "        estimatorElement.classList.add(theme);\n",
       "    }\n",
       "}\n",
       "\n",
       "forceTheme('sk-container-id-1');</script></body>"
      ],
      "text/plain": [
       "GridSearchCV(cv=5, estimator=SVC(kernel='linear'), n_jobs=-1,\n",
       "             param_grid={'C': [0.1, 1, 10, 100]}, scoring='accuracy')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split, GridSearchCV, cross_validate\n",
    "from sklearn.svm import SVC\n",
    "\n",
    "svc = SVC(kernel=\"linear\")\n",
    "grid_search = GridSearchCV(svc, {\"C\": [0.1, 1, 10, 100]}, cv=5, scoring=\"accuracy\", n_jobs=-1)\n",
    "grid_search.fit(x_train_flat, y_train_sub)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "62876e40",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Kernel  Best C Best Gamma Best Degree  Best Acc\n",
      "Linear     0.1        N/A         N/A    0.9132\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "best_estimators = {}\n",
    "\n",
    "best_model = grid_search.best_estimator_\n",
    "best_params = grid_search.best_params_\n",
    "best_score = grid_search.best_score_\n",
    "\n",
    "best_estimators[\"Linear\"] = best_model\n",
    "\n",
    "table1_data = []\n",
    "table1_data.append({\n",
    "    \"Kernel\" : \"Linear\",\n",
    "    \"Best C\": best_params.get(\"C\", \"N/A\"),\n",
    "    \"Best Gamma\": best_params.get(\"gamma\", \"N/A\"),\n",
    "    \"Best Degree\": best_params.get(\"degree\", \"N/A\"),\n",
    "    \"Best Acc\": best_score\n",
    "})\n",
    "\n",
    "df_table1 = pd.DataFrame(table1_data)\n",
    "print(df_table1.to_string(index=False))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "a25eb0ff",
   "metadata": {},
   "outputs": [],
   "source": [
    "table2_data = []\n",
    "\n",
    "cv_res = cross_validate(best_model, x_train_flat, y_train_sub, \n",
    "            cv=5, scoring=[\"accuracy\", \"recall_weighted\", \"f1_weighted\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "8d088ab3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'fit_time': array([1.05809426, 1.02123737, 1.02057838, 1.03010726, 0.9899869 ]),\n",
       " 'score_time': array([0.40557742, 0.40280175, 0.40119481, 0.40215659, 0.39224553]),\n",
       " 'test_accuracy': array([0.907, 0.916, 0.924, 0.917, 0.902]),\n",
       " 'test_recall_weighted': array([0.907, 0.916, 0.924, 0.917, 0.902]),\n",
       " 'test_f1_weighted': array([0.90672196, 0.91580509, 0.92439618, 0.91673165, 0.90117893])}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cv_res"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
