{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ced77d21",
   "metadata": {},
   "source": [
    "# Del CSV sucio a un Pipeline sin fuga de datos\n",
    "\n",
    "Notebook integrador del módulo de preparación de datos. Parte del CSV sucio de PyRitmo (faltantes, géneros mal\n",
    "escritos, duraciones en milisegundos y filas repetidas) y termina en un `Pipeline` que limpia, imputa, codifica,\n",
    "escala y entrena sin dejar que el test se cuele en ningún paso.\n",
    "\n",
    "**Objetivos** (lección 469)\n",
    "\n",
    "1. Limpiar lo que no depende de los datos: duplicados, escrituras de género y unidades.\n",
    "2. Aplicar la regla de oro: **`fit` solo en train, `transform` en todo lo demás**.\n",
    "3. Imputar con `SimpleImputer` (mediana para numéricas con atípicos, la más frecuente para categóricas).\n",
    "4. Codificar con `OneHotEncoder(handle_unknown=\"ignore\")` y escalar con `StandardScaler`.\n",
    "5. Juntar todo en un `ColumnTransformer` (el objeto `pre`) y en un `Pipeline` con el modelo.\n",
    "6. Medir el efecto de preprocesar antes de partir, y leer `get_feature_names_out()` y `set_output`."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f85c985b",
   "metadata": {},
   "source": [
    "## 1. Los datos sucios\n",
    "\n",
    "La primera celda copia `generar_canciones` y `ensuciar` (semillas 42 y 7, sin descargas), las listas de columnas del\n",
    "curso y `probar`. Es la misma celda en todos los notebooks."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f5f9d084",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:13.258057Z",
     "iopub.status.busy": "2026-10-18T17:51:13.257060Z",
     "iopub.status.idle": "2026-10-18T17:51:15.932825Z",
     "shell.execute_reply": "2026-10-18T17:51:15.930625Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Python 3.12.10 | scikit-learn 1.9.1 | pandas 3.0.6 | NumPy 2.5.4\n",
      "(1500, 15)\n"
     ]
    }
   ],
   "source": [
    "import sys\n",
    "import warnings\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import sklearn\n",
    "\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "print(\"Python\", sys.version.split()[0], \"| scikit-learn\", sklearn.__version__, \"| pandas\", pd.__version__,\n",
    "      \"| NumPy\", np.__version__)\n",
    "\n",
    "# Datos del curso (iguales en todos los notebooks): canciones de PyRitmo, app de streaming ficticia\n",
    "\n",
    "GENEROS = [\"pop\", \"reguetón\", \"rock\", \"electrónica\", \"regional\"]\n",
    "ESTILOS = [\"acustica\", \"bailable\", \"energica\", \"ambiental\"]\n",
    "DIAS = [\"lun\", \"mar\", \"mie\", \"jue\", \"vie\", \"sab\", \"dom\"]\n",
    "\n",
    "\n",
    "def _beta(rng, media, k, n):\n",
    "    return rng.beta(media * k, (1 - media) * k, n)\n",
    "\n",
    "\n",
    "def generar_canciones(n=1500, semilla=42):\n",
    "    rng = np.random.default_rng(semilla)\n",
    "    estilo = rng.choice(ESTILOS, n, p=[0.25, 0.35, 0.28, 0.12])\n",
    "    gen_p = {\n",
    "        \"acustica\":  [0.40, 0.05, 0.20, 0.00, 0.35],\n",
    "        \"bailable\":  [0.35, 0.45, 0.00, 0.10, 0.10],\n",
    "        \"energica\":  [0.15, 0.05, 0.50, 0.25, 0.05],\n",
    "        \"ambiental\": [0.10, 0.00, 0.05, 0.85, 0.00],\n",
    "    }\n",
    "    genero = np.array([rng.choice(GENEROS, p=gen_p[e]) for e in estilo])\n",
    "    perfil = {  # energia, bailabilidad, acustica, tempo, duracion\n",
    "        \"acustica\":  (0.30, 0.40, 0.75, 82, 215),\n",
    "        \"bailable\":  (0.70, 0.80, 0.15, 98, 190),\n",
    "        \"energica\":  (0.88, 0.50, 0.06, 138, 225),\n",
    "        \"ambiental\": (0.40, 0.35, 0.30, 115, 380),\n",
    "    }\n",
    "    P = np.array([perfil[e] for e in estilo])\n",
    "    energia = np.clip(P[:, 0] + rng.normal(0, 0.08, n), 0.02, 0.99).round(2)\n",
    "    bailabilidad = np.clip(P[:, 1] + rng.normal(0, 0.08, n), 0.05, 0.98).round(2)\n",
    "    acustica = np.clip(P[:, 2] + rng.normal(0, 0.08, n), 0.0, 0.99).round(2)\n",
    "    tempo = np.clip(P[:, 3] + rng.normal(0, 10, n), 60, 190).round(0)\n",
    "    duracion = np.clip(P[:, 4] + rng.normal(0, 35, n), 95, 600).round(0)\n",
    "    seguidores = np.round(rng.lognormal(4.5, 1.3, n), 1)            # miles de seguidores del artista\n",
    "    colaboracion = (rng.random(n) < np.where(estilo == \"bailable\", 0.45, 0.15)).astype(int)\n",
    "    explicita = (rng.random(n) < np.where(np.isin(genero, [\"reguetón\", \"rock\"]), 0.5, 0.1)).astype(int)\n",
    "    en_playlist = (rng.random(n) < 0.3).astype(int)                  # entró a una playlist editorial\n",
    "    largo_titulo = rng.integers(3, 40, n)\n",
    "    dia_lanzamiento = rng.choice(DIAS, n)\n",
    "\n",
    "    log_seg = np.log10(seguidores)\n",
    "    popularidad = (\n",
    "        8\n",
    "        + 11 * log_seg\n",
    "        + 12 * bailabilidad\n",
    "        + 9 * energia\n",
    "        + 10 * en_playlist\n",
    "        + 6 * colaboracion\n",
    "        - 0.03 * np.maximum(duracion - 240, 0)\n",
    "        + np.select([genero == \"reguetón\", genero == \"pop\", genero == \"regional\"], [6, 4, 3], 0)\n",
    "        + rng.normal(0, 6, n)\n",
    "    )\n",
    "    popularidad = np.clip(popularidad, 0, 100).round(0)\n",
    "\n",
    "    # entrar al Top 50: reglas con umbrales e interacciones (lo que los árboles capturan bien)\n",
    "    logit = (\n",
    "        -3.2\n",
    "        + 1.4 * (log_seg - 1.95)\n",
    "        + 2.0 * en_playlist\n",
    "        + 2.2 * colaboracion * (bailabilidad > 0.65)\n",
    "        + 1.6 * (energia > 0.6) * (duracion < 210)\n",
    "        - 2.0 * (duracion > 300)\n",
    "        + 1.2 * (genero == \"reguetón\")\n",
    "        + rng.normal(0, 0.6, n)\n",
    "    )\n",
    "    top50 = (rng.random(n) < 1 / (1 + np.exp(-logit))).astype(int)\n",
    "    reproducciones = np.round(10 ** (1.5 + 0.035 * popularidad + 0.5 * top50 + rng.normal(0, 0.15, n)), 1)\n",
    "\n",
    "    df = pd.DataFrame({\n",
    "        \"energia\": energia,\n",
    "        \"bailabilidad\": bailabilidad,\n",
    "        \"acustica\": acustica,\n",
    "        \"tempo_bpm\": tempo,\n",
    "        \"duracion_seg\": duracion,\n",
    "        \"seguidores_miles\": seguidores,\n",
    "        \"colaboracion\": colaboracion,\n",
    "        \"explicita\": explicita,\n",
    "        \"en_playlist\": en_playlist,\n",
    "        \"genero\": genero,\n",
    "        \"largo_titulo\": largo_titulo,\n",
    "        \"dia_lanzamiento\": dia_lanzamiento,\n",
    "        \"reproducciones_mes1\": reproducciones,   # miles; FUGA\n",
    "        \"popularidad\": popularidad,\n",
    "        \"top50\": top50,\n",
    "    })\n",
    "    return df, estilo\n",
    "\n",
    "\n",
    "def ensuciar(df, semilla=7):\n",
    "    \"\"\"Versión sucia: tempo y seguidores faltantes, géneros mal escritos, duraciones en ms y duplicados.\"\"\"\n",
    "    rng = np.random.default_rng(semilla)\n",
    "    d = df.copy()\n",
    "    n = len(d)\n",
    "    d.loc[rng.random(n) < 0.06, \"tempo_bpm\"] = np.nan\n",
    "    d.loc[rng.random(n) < 0.04, \"seguidores_miles\"] = np.nan\n",
    "    variantes = {\"pop\": [\"Pop\", \"POP\", \"pop \"], \"reguetón\": [\"reggaeton\", \"Reguetón\", \"regueton\"],\n",
    "                 \"rock\": [\"Rock\", \"rock \"], \"electrónica\": [\"electronica\", \"Electrónica\"],\n",
    "                 \"regional\": [\"Regional\", \"regional mexicano\"]}\n",
    "    for i in np.where(rng.random(n) < 0.08)[0]:\n",
    "        d.at[i, \"genero\"] = rng.choice(variantes[d.at[i, \"genero\"]])\n",
    "    ms = np.where(rng.random(n) < 0.01)[0]\n",
    "    d.loc[ms, \"duracion_seg\"] = d.loc[ms, \"duracion_seg\"] * 1000   # vino en milisegundos\n",
    "    dup = d.sample(25, random_state=semilla)\n",
    "    return pd.concat([d, dup], ignore_index=True)\n",
    "\n",
    "\n",
    "NUMERICAS = [\"energia\", \"bailabilidad\", \"acustica\", \"tempo_bpm\", \"duracion_seg\", \"seguidores_miles\",\n",
    "             \"colaboracion\", \"explicita\", \"en_playlist\"]\n",
    "CATEGORICAS = [\"genero\"]\n",
    "AUDIO = [\"energia\", \"bailabilidad\", \"acustica\", \"tempo_bpm\", \"duracion_seg\"]\n",
    "RUIDO = [\"largo_titulo\", \"dia_lanzamiento\"]\n",
    "FUGA = [\"reproducciones_mes1\"]\n",
    "\n",
    "\n",
    "def probar(nombre, pruebas, estricto=False):\n",
    "    \"\"\"Corre las pruebas de un ejercicio. Si aún no está resuelto, imprime 'pendiente' sin detener el notebook.\"\"\"\n",
    "    try:\n",
    "        pruebas()\n",
    "    except (AssertionError, NotImplementedError, TypeError, AttributeError, KeyError, ValueError,\n",
    "            IndexError) as e:\n",
    "        if estricto:\n",
    "            raise\n",
    "        print(f\"{nombre}: pendiente ({type(e).__name__})\")\n",
    "    else:\n",
    "        print(f\"{nombre}: correcto\")\n",
    "\n",
    "\n",
    "df, estilo = generar_canciones(n=1500, semilla=42)\n",
    "print(df.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5d32f66d",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:15.936658Z",
     "iopub.status.busy": "2026-10-18T17:51:15.936116Z",
     "iopub.status.idle": "2026-10-18T17:51:15.965222Z",
     "shell.execute_reply": "2026-10-18T17:51:15.964110Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "forma: (1525, 15) | filas duplicadas: 25\n",
      "faltantes: {'tempo_bpm': 86, 'seguidores_miles': 60}\n",
      "escrituras de género: 17\n",
      "filas con más de 1000 'segundos': 19\n"
     ]
    }
   ],
   "source": [
    "sucio = ensuciar(df, semilla=7)\n",
    "print(\"forma:\", sucio.shape, \"| filas duplicadas:\", sucio.duplicated().sum())\n",
    "print(\"faltantes:\", sucio.isna().sum()[lambda s: s > 0].to_dict())\n",
    "print(\"escrituras de género:\", sucio[\"genero\"].nunique())\n",
    "print(\"filas con más de 1000 'segundos':\", (sucio[\"duracion_seg\"] > 1000).sum())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "82614f58",
   "metadata": {},
   "source": [
    "1525 filas (25 repetidas), 86 faltantes en `tempo_bpm` y 60 en `seguidores_miles`, 17 escrituras distintas para 5\n",
    "géneros y 19 duraciones que vinieron en milisegundos.\n",
    "\n",
    "## 2. Limpieza que no aprende de los datos\n",
    "\n",
    "Hay dos tipos de arreglos. Los que siguen una regla fija (quitar duplicados, unificar `\"POP\"` y `\"pop \"`, dividir\n",
    "entre 1000 las duraciones imposibles) no calculan nada a partir de los datos: se pueden hacer antes de partir. Los\n",
    "que **aprenden** algo de los datos (la mediana para imputar, la media para escalar, las categorías del one-hot) van\n",
    "dentro del pipeline."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "377ca48e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:15.969382Z",
     "iopub.status.busy": "2026-10-18T17:51:15.968390Z",
     "iopub.status.idle": "2026-10-18T17:51:15.989297Z",
     "shell.execute_reply": "2026-10-18T17:51:15.988244Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "forma: (1500, 15)\n",
      "géneros: {'pop': 400, 'electrónica': 312, 'rock': 305, 'reguetón': 271, 'regional': 212}\n",
      "faltantes que quedan: {'tempo_bpm': 85, 'seguidores_miles': 59}\n"
     ]
    }
   ],
   "source": [
    "MAPA_GENERO = {\"pop\": \"pop\", \"reggaeton\": \"reguetón\", \"regueton\": \"reguetón\", \"reguetón\": \"reguetón\",\n",
    "               \"rock\": \"rock\", \"electronica\": \"electrónica\", \"electrónica\": \"electrónica\",\n",
    "               \"regional\": \"regional\", \"regional mexicano\": \"regional\"}\n",
    "\n",
    "\n",
    "def limpiar(sucio):\n",
    "    d = sucio.drop_duplicates().copy()\n",
    "    d[\"genero\"] = d[\"genero\"].str.strip().str.lower().map(MAPA_GENERO)\n",
    "    en_ms = d[\"duracion_seg\"] > 1000\n",
    "    d.loc[en_ms, \"duracion_seg\"] = d.loc[en_ms, \"duracion_seg\"] / 1000\n",
    "    return d.reset_index(drop=True)\n",
    "\n",
    "\n",
    "limpio = limpiar(sucio)\n",
    "print(\"forma:\", limpio.shape)\n",
    "print(\"géneros:\", limpio[\"genero\"].value_counts().to_dict())\n",
    "print(\"faltantes que quedan:\", limpio.isna().sum()[lambda s: s > 0].to_dict())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "751ed5e4",
   "metadata": {},
   "source": [
    "Quedan 1500 canciones, 5 géneros y los faltantes reales: 85 en `tempo_bpm` y 59 en `seguidores_miles` (uno de cada\n",
    "uno estaba en una fila duplicada). Esos **no** se rellenan aquí.\n",
    "\n",
    "## 3. Partir antes de aprender nada"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e03abc74",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:15.993700Z",
     "iopub.status.busy": "2026-10-18T17:51:15.993155Z",
     "iopub.status.idle": "2026-10-18T17:51:16.180409Z",
     "shell.execute_reply": "2026-10-18T17:51:16.179400Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " (1125, 10) | test (375, 10)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "faltantes en train: {'tempo_bpm': 64, 'seguidores_miles': 44}\n",
      "faltantes en test:  {'tempo_bpm': 21, 'seguidores_miles': 15}\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "X = limpio[NUMERICAS + CATEGORICAS]\n",
    "y = limpio[\"top50\"]\n",
    "X_tr, X_te, y_tr, y_te = train_test_split(X, y, test_size=0.25, stratify=y, random_state=42)\n",
    "print(\"train\", X_tr.shape, \"| test\", X_te.shape)\n",
    "print(\"faltantes en train:\", X_tr.isna().sum()[lambda s: s > 0].to_dict())\n",
    "print(\"faltantes en test: \", X_te.isna().sum()[lambda s: s > 0].to_dict())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b37d4e7f",
   "metadata": {},
   "source": [
    "Los faltantes quedan repartidos: 64 y 44 en train, 21 y 15 en test. Desde aquí, cualquier cosa que se calcule\n",
    "(medianas, medias, desviaciones, categorías) sale **solo de `X_tr`**.\n",
    "\n",
    "## 4. Imputar: mediana o media\n",
    "\n",
    "`seguidores_miles` tiene artistas gigantes. Compara la media y la mediana de train:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "54452764",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.183743Z",
     "iopub.status.busy": "2026-10-18T17:51:16.183743Z",
     "iopub.status.idle": "2026-10-18T17:51:16.192245Z",
     "shell.execute_reply": "2026-10-18T17:51:16.191238Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "seguidores_miles en train -> media: 231.9 | mediana: 88.2\n",
      "tempo_bpm en train        -> media: 106.5 | mediana: 103.0\n"
     ]
    }
   ],
   "source": [
    "print(\"seguidores_miles en train -> media:\", round(X_tr[\"seguidores_miles\"].mean(), 1),\n",
    "      \"| mediana:\", round(X_tr[\"seguidores_miles\"].median(), 1))\n",
    "print(\"tempo_bpm en train        -> media:\", round(X_tr[\"tempo_bpm\"].mean(), 1),\n",
    "      \"| mediana:\", round(X_tr[\"tempo_bpm\"].median(), 1))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c88ecc54",
   "metadata": {},
   "source": [
    "En `seguidores_miles` la media (231.9 mil) es 2.6 veces la mediana (88.2 mil) por culpa de unos pocos artistas\n",
    "enormes: imputar con la media\n",
    "le daría a cada faltante un artista mucho más grande que el típico. La mediana no se mueve con los atípicos, por eso\n",
    "es la opción por omisión para numéricas. Para categóricas se usa la más frecuente (`most_frequent`).\n",
    "\n",
    "## 5. El objeto `pre`\n",
    "\n",
    "Dos mini pipelines, uno por tipo de columna, unidos con `ColumnTransformer`:\n",
    "\n",
    "- **Numéricas (9):** `SimpleImputer(strategy=\"median\")` y luego `StandardScaler`.\n",
    "- **Categórica (`genero`):** `SimpleImputer(strategy=\"most_frequent\")` y luego\n",
    "  `OneHotEncoder(handle_unknown=\"ignore\")`. Con `handle_unknown=\"ignore\"`, un género que no apareció en train se\n",
    "  codifica como ceros en lugar de romper la predicción.\n",
    "\n",
    "`sparse_output=False` hace que el one-hot devuelva un arreglo normal; así funciona `set_output` más abajo."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "e3f60390",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.197246Z",
     "iopub.status.busy": "2026-10-18T17:51:16.196244Z",
     "iopub.status.idle": "2026-10-18T17:51:16.464408Z",
     "shell.execute_reply": "2026-10-18T17:51:16.462892Z"
    }
   },
   "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",
       "    border: none;\n",
       "    padding: 0;\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       ".copy-paste-icon:focus-visible {\n",
       "    outline: 1px solid currentColor;\n",
       "    outline-offset: 1px;\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-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>ColumnTransformer(transformers=[(&#x27;num&#x27;,\n",
       "                                 Pipeline(steps=[(&#x27;imputar&#x27;,\n",
       "                                                  SimpleImputer(strategy=&#x27;median&#x27;)),\n",
       "                                                 (&#x27;escalar&#x27;,\n",
       "                                                  StandardScaler())]),\n",
       "                                 [&#x27;energia&#x27;, &#x27;bailabilidad&#x27;, &#x27;acustica&#x27;,\n",
       "                                  &#x27;tempo_bpm&#x27;, &#x27;duracion_seg&#x27;,\n",
       "                                  &#x27;seguidores_miles&#x27;, &#x27;colaboracion&#x27;,\n",
       "                                  &#x27;explicita&#x27;, &#x27;en_playlist&#x27;]),\n",
       "                                (&#x27;cat&#x27;,\n",
       "                                 Pipeline(steps=[(&#x27;imputar&#x27;,\n",
       "                                                  SimpleImputer(strategy=&#x27;most_frequent&#x27;)),\n",
       "                                                 (&#x27;onehot&#x27;,\n",
       "                                                  OneHotEncoder(handle_unknown=&#x27;ignore&#x27;,\n",
       "                                                                sparse_output=False))]),\n",
       "                                 [&#x27;genero&#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  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  sk-toggleable__label-arrow\"><div><div>ColumnTransformer</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html\">?<span>Documentation for ColumnTransformer</span></a><span class=\"sk-estimator-doc-link \">i<span>Not fitted</span></span></div></label><div class=\"sk-toggleable__content \" 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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy transformers to clipboard\"\n",
       "                 onclick=\"copyToClipboard('transformers',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-transformers;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=transformers,-list%20of%20tuples\">\n",
       "            transformers\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-transformers;\">\n",
       "            transformers: list of tuples<br><br>List of (name, transformer, columns) tuples specifying the<br>transformer objects to be applied to subsets of the data.<br><br>name : str<br>    Like in Pipeline and FeatureUnion, this allows the transformer and<br>    its parameters to be set using ``set_params`` and searched in grid<br>    search.<br>transformer : {&#x27;drop&#x27;, &#x27;passthrough&#x27;} or estimator<br>    Estimator must support :term:`fit` and :term:`transform`.<br>    Special-cased strings &#x27;drop&#x27; and &#x27;passthrough&#x27; are accepted as<br>    well, to indicate to drop the columns or to pass them through<br>    untransformed, respectively.<br>columns :  str, array-like of str, int, array-like of int,                 array-like of bool, slice or callable<br>    Indexes the data on its second axis. Integers are interpreted as<br>    positional columns, while strings can reference DataFrame columns<br>    by name.  A scalar string or int should be used where<br>    ``transformer`` expects X to be a 1d array-like (vector),<br>    otherwise a 2d array will be passed to the transformer.<br>    A callable is passed the input data `X` and can return any of the<br>    above. To select multiple columns by name or dtype, you can use<br>    :obj:`make_column_selector`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">[(&#x27;num&#x27;, ...), (&#x27;cat&#x27;, ...)]</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy remainder to clipboard\"\n",
       "                 onclick=\"copyToClipboard('remainder',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-remainder;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=remainder,-%7B%27drop%27%2C%20%27passthrough%27%7D%20or%20estimator%2C%20default%3D%27drop%27\">\n",
       "            remainder\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-remainder;\">\n",
       "            remainder: {&#x27;drop&#x27;, &#x27;passthrough&#x27;} or estimator, default=&#x27;drop&#x27;<br><br>By default, only the specified columns in `transformers` are<br>transformed and combined in the output, and the non-specified<br>columns are dropped. (default of ``&#x27;drop&#x27;``).<br>By specifying ``remainder=&#x27;passthrough&#x27;``, all remaining columns that<br>were not specified in `transformers`, but present in the data passed<br>to `fit` will be automatically passed through. This subset of columns<br>is concatenated with the output of the transformers. For dataframes,<br>extra columns not seen during `fit` will be excluded from the output<br>of `transform`.<br>By setting ``remainder`` to be an estimator, the remaining<br>non-specified columns will use the ``remainder`` estimator. The<br>estimator must support :term:`fit` and :term:`transform`.<br>Note that using this feature requires that the DataFrame columns<br>input at :term:`fit` and :term:`transform` have identical order.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;drop&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy sparse_threshold to clipboard\"\n",
       "                 onclick=\"copyToClipboard('sparse_threshold',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-sparse_threshold;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=sparse_threshold,-float%2C%20default%3D0.3\">\n",
       "            sparse_threshold\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-sparse_threshold;\">\n",
       "            sparse_threshold: float, default=0.3<br><br>If the output of the different transformers contains sparse matrices,<br>these will be stacked as a sparse matrix if the overall density is<br>lower than this value. Use ``sparse_threshold=0`` to always return<br>dense.  When the transformed output consists of all dense data, the<br>stacked result will be dense, and this keyword will be ignored.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0.3</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy n_jobs to clipboard\"\n",
       "                 onclick=\"copyToClipboard('n_jobs',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></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.compose.ColumnTransformer.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.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy transformer_weights to clipboard\"\n",
       "                 onclick=\"copyToClipboard('transformer_weights',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-transformer_weights;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=transformer_weights,-dict%2C%20default%3DNone\">\n",
       "            transformer_weights\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-transformer_weights;\">\n",
       "            transformer_weights: dict, default=None<br><br>Multiplicative weights for features per transformer. The output of the<br>transformer is multiplied by these weights. Keys are transformer names,<br>values the weights.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy verbose to clipboard\"\n",
       "                 onclick=\"copyToClipboard('verbose',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></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.compose.ColumnTransformer.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>If True, the time elapsed while fitting each transformer will be<br>printed as it is completed.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy verbose_feature_names_out to clipboard\"\n",
       "                 onclick=\"copyToClipboard('verbose_feature_names_out',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-verbose_feature_names_out;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=verbose_feature_names_out,-bool%2C%20str%20or%20Callable%5B%5Bstr%2C%20str%5D%2C%20str%5D%2C%20default%3DTrue\">\n",
       "            verbose_feature_names_out\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-verbose_feature_names_out;\">\n",
       "            verbose_feature_names_out: bool, str or Callable[[str, str], str], default=True<br><br>- If True, :meth:`ColumnTransformer.get_feature_names_out` will prefix<br>  all feature names with the name of the transformer that generated that<br>  feature. It is equivalent to setting<br>  `verbose_feature_names_out=&quot;{transformer_name}__{feature_name}&quot;`.<br>- If False, :meth:`ColumnTransformer.get_feature_names_out` will not<br>  prefix any feature names and will error if feature names are not<br>  unique.<br>- If ``Callable[[str, str], str]``,<br>  :meth:`ColumnTransformer.get_feature_names_out` will rename all the features<br>  using the name of the transformer. The first argument of the callable is the<br>  transformer name and the second argument is the feature name. The returned<br>  string will be the new feature name.<br>- If ``str``, it must be a string ready for formatting. The given string will<br>  be formatted using two field names: ``transformer_name`` and ``feature_name``.<br>  e.g. ``&quot;{feature_name}__{transformer_name}&quot;``. See :meth:`str.format` method<br>  from the standard library for more info.<br><br>.. versionadded:: 1.0<br><br>.. versionchanged:: 1.6<br>    `verbose_feature_names_out` can be a callable or a string to be formatted.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\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  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  sk-toggleable__label-arrow\"><div><div>num</div></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"num__\"><pre>[&#x27;energia&#x27;, &#x27;bailabilidad&#x27;, &#x27;acustica&#x27;, &#x27;tempo_bpm&#x27;, &#x27;duracion_seg&#x27;, &#x27;seguidores_miles&#x27;, &#x27;colaboracion&#x27;, &#x27;explicita&#x27;, &#x27;en_playlist&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator  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  sk-toggleable__label-arrow\"><div><div>SimpleImputer</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html\">?<span>Documentation for SimpleImputer</span></a></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"num__imputar__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy strategy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('strategy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-strategy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=strategy,-str%20or%20Callable%2C%20default%3D%27mean%27\">\n",
       "            strategy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-strategy;\">\n",
       "            strategy: str or Callable, default=&#x27;mean&#x27;<br><br>The imputation strategy.<br><br>- If &quot;mean&quot;, then replace missing values using the mean along<br>  each column. Can only be used with numeric data.<br>- If &quot;median&quot;, then replace missing values using the median along<br>  each column. Can only be used with numeric data.<br>- If &quot;most_frequent&quot;, then replace missing using the most frequent<br>  value along each column. Can be used with strings or numeric data.<br>  If there is more than one such value, only the smallest is returned.<br>- If &quot;constant&quot;, then replace missing values with fill_value. Can be<br>  used with strings or numeric data.<br>- If an instance of Callable, then replace missing values using the<br>  scalar statistic returned by running the callable over a dense 1d<br>  array containing non-missing values of each column.<br><br>.. versionadded:: 0.20<br>   strategy=&quot;constant&quot; for fixed value imputation.<br><br>.. versionadded:: 1.5<br>   strategy=callable for custom value imputation.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;median&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy missing_values to clipboard\"\n",
       "                 onclick=\"copyToClipboard('missing_values',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-missing_values;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=missing_values,-int%2C%20float%2C%20str%2C%20np.nan%2C%20None%20or%20pandas.NA%2C%20default%3Dnp.nan\">\n",
       "            missing_values\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-missing_values;\">\n",
       "            missing_values: int, float, str, np.nan, None or pandas.NA, default=np.nan<br><br>The placeholder for the missing values. All occurrences of<br>`missing_values` will be imputed. For pandas&#x27; dataframes with<br>nullable integer dtypes with missing values, `missing_values`<br>can be set to either `np.nan` or `pd.NA`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">nan</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy fill_value to clipboard\"\n",
       "                 onclick=\"copyToClipboard('fill_value',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-fill_value;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=fill_value,-str%20or%20numerical%20value%2C%20default%3DNone\">\n",
       "            fill_value\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-fill_value;\">\n",
       "            fill_value: str or numerical value, default=None<br><br>When strategy == &quot;constant&quot;, `fill_value` is used to replace all<br>occurrences of missing_values. For string or object data types,<br>`fill_value` must be a string.<br>If `None`, `fill_value` will be 0 when imputing numerical<br>data and &quot;missing_value&quot; for strings or object data types.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If True, a copy of X will be created. If False, imputation will<br>be done in-place whenever possible. Note that, in the following cases,<br>a new copy will always be made, even if `copy=False`:<br><br>- If `X` is not an array of floating values;<br>- If `X` is encoded as a CSR matrix;<br>- If `add_indicator=True`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy add_indicator to clipboard\"\n",
       "                 onclick=\"copyToClipboard('add_indicator',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-add_indicator;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=add_indicator,-bool%2C%20default%3DFalse\">\n",
       "            add_indicator\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-add_indicator;\">\n",
       "            add_indicator: bool, default=False<br><br>If True, a :class:`MissingIndicator` transform will stack onto output<br>of the imputer&#x27;s transform. This allows a predictive estimator<br>to account for missingness despite imputation. If a feature has no<br>missing values at fit/train time, the feature won&#x27;t appear on<br>the missing indicator even if there are missing values at<br>transform/test time.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy keep_empty_features to clipboard\"\n",
       "                 onclick=\"copyToClipboard('keep_empty_features',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-keep_empty_features;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=keep_empty_features,-bool%2C%20default%3DFalse\">\n",
       "            keep_empty_features\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-keep_empty_features;\">\n",
       "            keep_empty_features: bool, default=False<br><br>If True, features that consist exclusively of missing values when<br>`fit` is called are returned in results when `transform` is called.<br>The imputed value is always `0` except when `strategy=&quot;constant&quot;`<br>in which case `fill_value` will be used instead.<br><br>.. versionadded:: 1.2</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-4\" type=\"checkbox\" ><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>StandardScaler</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html\">?<span>Documentation for StandardScaler</span></a></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"num__escalar__\">\n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Parameters</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If False, try to avoid a copy and do inplace scaling instead.<br>This is not guaranteed to always work inplace; e.g. if the data is<br>not a NumPy array or scipy.sparse CSR matrix, a copy may still be<br>returned.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy with_mean to clipboard\"\n",
       "                 onclick=\"copyToClipboard('with_mean',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-with_mean;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=with_mean,-bool%2C%20default%3DTrue\">\n",
       "            with_mean\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-with_mean;\">\n",
       "            with_mean: bool, default=True<br><br>If True, center the data before scaling.<br>This does not work (and will raise an exception) when attempted on<br>sparse matrices, because centering them entails building a dense<br>matrix which in common use cases is likely to be too large to fit in<br>memory.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy with_std to clipboard\"\n",
       "                 onclick=\"copyToClipboard('with_std',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-with_std;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=with_std,-bool%2C%20default%3DTrue\">\n",
       "            with_std\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-with_std;\">\n",
       "            with_std: bool, default=True<br><br>If True, scale the data to unit variance (or equivalently,<br>unit standard deviation).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div></div></div></div></div></div><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-5\" type=\"checkbox\" ><label for=\"sk-estimator-id-5\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>cat</div></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"cat__\"><pre>[&#x27;genero&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-6\" type=\"checkbox\" ><label for=\"sk-estimator-id-6\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>SimpleImputer</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html\">?<span>Documentation for SimpleImputer</span></a></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"cat__imputar__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy strategy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('strategy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-strategy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=strategy,-str%20or%20Callable%2C%20default%3D%27mean%27\">\n",
       "            strategy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-strategy;\">\n",
       "            strategy: str or Callable, default=&#x27;mean&#x27;<br><br>The imputation strategy.<br><br>- If &quot;mean&quot;, then replace missing values using the mean along<br>  each column. Can only be used with numeric data.<br>- If &quot;median&quot;, then replace missing values using the median along<br>  each column. Can only be used with numeric data.<br>- If &quot;most_frequent&quot;, then replace missing using the most frequent<br>  value along each column. Can be used with strings or numeric data.<br>  If there is more than one such value, only the smallest is returned.<br>- If &quot;constant&quot;, then replace missing values with fill_value. Can be<br>  used with strings or numeric data.<br>- If an instance of Callable, then replace missing values using the<br>  scalar statistic returned by running the callable over a dense 1d<br>  array containing non-missing values of each column.<br><br>.. versionadded:: 0.20<br>   strategy=&quot;constant&quot; for fixed value imputation.<br><br>.. versionadded:: 1.5<br>   strategy=callable for custom value imputation.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;most_frequent&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy missing_values to clipboard\"\n",
       "                 onclick=\"copyToClipboard('missing_values',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-missing_values;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=missing_values,-int%2C%20float%2C%20str%2C%20np.nan%2C%20None%20or%20pandas.NA%2C%20default%3Dnp.nan\">\n",
       "            missing_values\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-missing_values;\">\n",
       "            missing_values: int, float, str, np.nan, None or pandas.NA, default=np.nan<br><br>The placeholder for the missing values. All occurrences of<br>`missing_values` will be imputed. For pandas&#x27; dataframes with<br>nullable integer dtypes with missing values, `missing_values`<br>can be set to either `np.nan` or `pd.NA`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">nan</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy fill_value to clipboard\"\n",
       "                 onclick=\"copyToClipboard('fill_value',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-fill_value;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=fill_value,-str%20or%20numerical%20value%2C%20default%3DNone\">\n",
       "            fill_value\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-fill_value;\">\n",
       "            fill_value: str or numerical value, default=None<br><br>When strategy == &quot;constant&quot;, `fill_value` is used to replace all<br>occurrences of missing_values. For string or object data types,<br>`fill_value` must be a string.<br>If `None`, `fill_value` will be 0 when imputing numerical<br>data and &quot;missing_value&quot; for strings or object data types.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If True, a copy of X will be created. If False, imputation will<br>be done in-place whenever possible. Note that, in the following cases,<br>a new copy will always be made, even if `copy=False`:<br><br>- If `X` is not an array of floating values;<br>- If `X` is encoded as a CSR matrix;<br>- If `add_indicator=True`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy add_indicator to clipboard\"\n",
       "                 onclick=\"copyToClipboard('add_indicator',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-add_indicator;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=add_indicator,-bool%2C%20default%3DFalse\">\n",
       "            add_indicator\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-add_indicator;\">\n",
       "            add_indicator: bool, default=False<br><br>If True, a :class:`MissingIndicator` transform will stack onto output<br>of the imputer&#x27;s transform. This allows a predictive estimator<br>to account for missingness despite imputation. If a feature has no<br>missing values at fit/train time, the feature won&#x27;t appear on<br>the missing indicator even if there are missing values at<br>transform/test time.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy keep_empty_features to clipboard\"\n",
       "                 onclick=\"copyToClipboard('keep_empty_features',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-keep_empty_features;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=keep_empty_features,-bool%2C%20default%3DFalse\">\n",
       "            keep_empty_features\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-keep_empty_features;\">\n",
       "            keep_empty_features: bool, default=False<br><br>If True, features that consist exclusively of missing values when<br>`fit` is called are returned in results when `transform` is called.<br>The imputed value is always `0` except when `strategy=&quot;constant&quot;`<br>in which case `fill_value` will be used instead.<br><br>.. versionadded:: 1.2</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div><div class=\"sk-item\"><div class=\"sk-estimator  sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually sk-global\" id=\"sk-estimator-id-7\" type=\"checkbox\" ><label for=\"sk-estimator-id-7\" class=\"sk-toggleable__label  sk-toggleable__label-arrow\"><div><div>OneHotEncoder</div></div><div><a class=\"sk-estimator-doc-link \" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html\">?<span>Documentation for OneHotEncoder</span></a></div></label><div class=\"sk-toggleable__content \" data-param-prefix=\"cat__onehot__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy sparse_output to clipboard\"\n",
       "                 onclick=\"copyToClipboard('sparse_output',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-sparse_output;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=sparse_output,-bool%2C%20default%3DTrue\">\n",
       "            sparse_output\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-sparse_output;\">\n",
       "            sparse_output: bool, default=True<br><br>When ``True``, it returns a SciPy sparse matrix/array<br>in &quot;Compressed Sparse Row&quot; (CSR) format.<br><br>.. versionadded:: 1.2<br>   `sparse` was renamed to `sparse_output`</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy handle_unknown to clipboard\"\n",
       "                 onclick=\"copyToClipboard('handle_unknown',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-handle_unknown;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=handle_unknown,-%7B%27error%27%2C%20%27ignore%27%2C%20%27infrequent_if_exist%27%2C%20%27warn%27%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3D%27error%27\">\n",
       "            handle_unknown\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-handle_unknown;\">\n",
       "            handle_unknown: {&#x27;error&#x27;, &#x27;ignore&#x27;, &#x27;infrequent_if_exist&#x27;, &#x27;warn&#x27;},                      default=&#x27;error&#x27;<br><br>Specifies the way unknown categories are handled during :meth:`transform`.<br><br>- &#x27;error&#x27; : Raise an error if an unknown category is present during transform.<br>- &#x27;ignore&#x27; : When an unknown category is encountered during<br>  transform, the resulting one-hot encoded columns for this feature<br>  will be all zeros. In the inverse transform, an unknown category<br>  will be denoted as None.<br>- &#x27;infrequent_if_exist&#x27; : When an unknown category is encountered<br>  during transform, the resulting one-hot encoded columns for this<br>  feature will map to the infrequent category if it exists. The<br>  infrequent category will be mapped to the last position in the<br>  encoding. During inverse transform, an unknown category will be<br>  mapped to the category denoted `&#x27;infrequent&#x27;` if it exists. If the<br>  `&#x27;infrequent&#x27;` category does not exist, then :meth:`transform` and<br>  :meth:`inverse_transform` will handle an unknown category as with<br>  `handle_unknown=&#x27;ignore&#x27;`. Infrequent categories exist based on<br>  `min_frequency` and `max_categories`. Read more in the<br>  :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.<br>- &#x27;warn&#x27; : When an unknown category is encountered during transform<br>  a warning is issued, and the encoding then proceeds as described for<br>  `handle_unknown=&quot;infrequent_if_exist&quot;`.<br><br>.. versionchanged:: 1.1<br>    `&#x27;infrequent_if_exist&#x27;` was added to automatically handle unknown<br>    categories and infrequent categories.<br><br>.. versionadded:: 1.6<br>   The option `&quot;warn&quot;` was added in 1.6.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;ignore&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy categories to clipboard\"\n",
       "                 onclick=\"copyToClipboard('categories',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-categories;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=categories,-%27auto%27%20or%20a%20list%20of%20array-like%2C%20default%3D%27auto%27\">\n",
       "            categories\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-categories;\">\n",
       "            categories: &#x27;auto&#x27; or a list of array-like, default=&#x27;auto&#x27;<br><br>Categories (unique values) per feature:<br><br>- &#x27;auto&#x27; : Determine categories automatically from the training data.<br>- list : ``categories[i]`` holds the categories expected in the ith<br>  column. The passed categories should not mix strings and numeric<br>  values within a single feature, and should be sorted in case of<br>  numeric values.<br><br>The used categories can be found in the ``categories_`` attribute.<br><br>.. versionadded:: 0.20</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;auto&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy drop to clipboard\"\n",
       "                 onclick=\"copyToClipboard('drop',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-drop;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=drop,-%7B%27first%27%2C%20%27if_binary%27%7D%20or%20an%20array-like%20of%20shape%20%28n_features%2C%29%2C%20%20%20%20%20%20%20%20%20%20%20%20%20default%3DNone\">\n",
       "            drop\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-drop;\">\n",
       "            drop: {&#x27;first&#x27;, &#x27;if_binary&#x27;} or an array-like of shape (n_features,),             default=None<br><br>Specifies a methodology to use to drop one of the categories per<br>feature. This is useful in situations where perfectly collinear<br>features cause problems, such as when feeding the resulting data<br>into an unregularized linear regression model.<br><br>However, dropping one category breaks the symmetry of the original<br>representation and can therefore induce a bias in downstream models,<br>for instance for penalized linear classification or regression models.<br><br>- None : retain all features (the default).<br>- &#x27;first&#x27; : drop the first category in each feature. If only one<br>  category is present, the feature will be dropped entirely.<br>- &#x27;if_binary&#x27; : drop the first category in each feature with two<br>  categories. Features with 1 or more than 2 categories are<br>  left intact.<br>- array : ``drop[i]`` is the category in feature ``X[:, i]`` that<br>  should be dropped.<br><br>When `max_categories` or `min_frequency` is configured to group<br>infrequent categories, the dropping behavior is handled after the<br>grouping.<br><br>.. versionadded:: 0.21<br>   The parameter `drop` was added in 0.21.<br><br>.. versionchanged:: 0.23<br>   The option `drop=&#x27;if_binary&#x27;` was added in 0.23.<br><br>.. versionchanged:: 1.1<br>    Support for dropping infrequent categories.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy dtype to clipboard\"\n",
       "                 onclick=\"copyToClipboard('dtype',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-dtype;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=dtype,-number%20type%2C%20default%3Dnp.float64\">\n",
       "            dtype\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-dtype;\">\n",
       "            dtype: number type, default=np.float64<br><br>Desired dtype of output.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&lt;class &#x27;numpy.float64&#x27;&gt;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy min_frequency to clipboard\"\n",
       "                 onclick=\"copyToClipboard('min_frequency',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-min_frequency;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=min_frequency,-int%20or%20float%2C%20default%3DNone\">\n",
       "            min_frequency\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-min_frequency;\">\n",
       "            min_frequency: int or float, default=None<br><br>Specifies the minimum frequency below which a category will be<br>considered infrequent.<br><br>- If `int`, categories with a smaller cardinality will be considered<br>  infrequent.<br><br>- If `float`, categories with a smaller cardinality than<br>  `min_frequency * n_samples`  will be considered infrequent.<br><br>.. versionadded:: 1.1<br>    Read more in the :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy max_categories to clipboard\"\n",
       "                 onclick=\"copyToClipboard('max_categories',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-max_categories;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=max_categories,-int%2C%20default%3DNone\">\n",
       "            max_categories\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-max_categories;\">\n",
       "            max_categories: int, default=None<br><br>Specifies an upper limit to the number of output features for each input<br>feature when considering infrequent categories. If there are infrequent<br>categories, `max_categories` includes the category representing the<br>infrequent categories along with the frequent categories. If `None`,<br>there is no limit to the number of output features.<br><br>.. versionadded:: 1.1<br>    Read more in the :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy feature_name_combiner to clipboard\"\n",
       "                 onclick=\"copyToClipboard('feature_name_combiner',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-feature_name_combiner;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=feature_name_combiner,-%22concat%22%20or%20callable%2C%20default%3D%22concat%22\">\n",
       "            feature_name_combiner\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-feature_name_combiner;\">\n",
       "            feature_name_combiner: &quot;concat&quot; or callable, default=&quot;concat&quot;<br><br>Callable with signature `def callable(input_feature, category)` that returns a<br>string. This is used to create feature names to be returned by<br>:meth:`get_feature_names_out`.<br><br>`&quot;concat&quot;` concatenates encoded feature name and category with<br>`feature + &quot;_&quot; + str(category)`.E.g. feature X with values 1, 6, 7 create<br>feature names `X_1, X_6, X_7`.<br><br>.. versionadded:: 1.3</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;concat&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></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": [
       "ColumnTransformer(transformers=[('num',\n",
       "                                 Pipeline(steps=[('imputar',\n",
       "                                                  SimpleImputer(strategy='median')),\n",
       "                                                 ('escalar',\n",
       "                                                  StandardScaler())]),\n",
       "                                 ['energia', 'bailabilidad', 'acustica',\n",
       "                                  'tempo_bpm', 'duracion_seg',\n",
       "                                  'seguidores_miles', 'colaboracion',\n",
       "                                  'explicita', 'en_playlist']),\n",
       "                                ('cat',\n",
       "                                 Pipeline(steps=[('imputar',\n",
       "                                                  SimpleImputer(strategy='most_frequent')),\n",
       "                                                 ('onehot',\n",
       "                                                  OneHotEncoder(handle_unknown='ignore',\n",
       "                                                                sparse_output=False))]),\n",
       "                                 ['genero'])])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.compose import ColumnTransformer\n",
    "from sklearn.impute import SimpleImputer\n",
    "from sklearn.pipeline import Pipeline\n",
    "from sklearn.preprocessing import OneHotEncoder, StandardScaler\n",
    "\n",
    "\n",
    "def crear_pre(estrategia_num=\"median\"):\n",
    "    numericas = Pipeline([(\"imputar\", SimpleImputer(strategy=estrategia_num)), (\"escalar\", StandardScaler())])\n",
    "    categoricas = Pipeline([(\"imputar\", SimpleImputer(strategy=\"most_frequent\")),\n",
    "                            (\"onehot\", OneHotEncoder(handle_unknown=\"ignore\", sparse_output=False))])\n",
    "    return ColumnTransformer([(\"num\", numericas, NUMERICAS), (\"cat\", categoricas, CATEGORICAS)])\n",
    "\n",
    "\n",
    "pre = crear_pre()\n",
    "pre"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e7964017",
   "metadata": {},
   "source": [
    "## 6. Pipeline con el modelo\n",
    "\n",
    "El pipeline encadena `pre` y la regresión logística. Un solo `fit` sobre train ajusta el imputador, el escalador, el\n",
    "codificador y el modelo, en ese orden. Al predecir, aplica los mismos pasos ya aprendidos."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "cb76d457",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.468411Z",
     "iopub.status.busy": "2026-10-18T17:51:16.468411Z",
     "iopub.status.idle": "2026-10-18T17:51:16.661989Z",
     "shell.execute_reply": "2026-10-18T17:51:16.659983Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy en test -> pipeline: 0.808 | Dummy: 0.725\n",
      "AUC en test del pipeline: 0.847\n"
     ]
    }
   ],
   "source": [
    "from sklearn.dummy import DummyClassifier\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.metrics import roc_auc_score\n",
    "\n",
    "pipe = Pipeline([(\"pre\", crear_pre()), (\"modelo\", LogisticRegression(max_iter=2000))])\n",
    "pipe.fit(X_tr, y_tr)\n",
    "dummy = Pipeline([(\"pre\", crear_pre()), (\"modelo\", DummyClassifier())]).fit(X_tr, y_tr)\n",
    "\n",
    "print(\"accuracy en test -> pipeline:\", round(pipe.score(X_te, y_te), 3), \"| Dummy:\", round(dummy.score(X_te, y_te), 3))\n",
    "print(\"AUC en test del pipeline:\", round(roc_auc_score(y_te, pipe.predict_proba(X_te)[:, 1]), 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6102e668",
   "metadata": {},
   "source": [
    "Accuracy de **0.808** contra 0.725 del Dummy, y AUC de 0.847. El test tenía faltantes y el pipeline los rellenó con\n",
    "la mediana aprendida en train, sin que tuvieras que escribir nada aparte.\n",
    "\n",
    "`named_steps` da acceso a cada paso. La mediana que aprendió el imputador numérico:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9b5965a0",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.665989Z",
     "iopub.status.busy": "2026-10-18T17:51:16.664990Z",
     "iopub.status.idle": "2026-10-18T17:51:16.673027Z",
     "shell.execute_reply": "2026-10-18T17:51:16.672019Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "medianas aprendidas en train: {'energia': np.float64(0.7), 'bailabilidad': np.float64(0.5), 'acustica': np.float64(0.2), 'tempo_bpm': np.float64(103.0), 'duracion_seg': np.float64(212.0), 'seguidores_miles': np.float64(88.2), 'colaboracion': np.float64(0.0), 'explicita': np.float64(0.0), 'en_playlist': np.float64(0.0)}\n"
     ]
    }
   ],
   "source": [
    "imputador = pipe.named_steps[\"pre\"].named_transformers_[\"num\"].named_steps[\"imputar\"]\n",
    "print(\"medianas aprendidas en train:\", dict(zip(NUMERICAS, imputador.statistics_.round(1))))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c77b5094",
   "metadata": {},
   "source": [
    "103 bpm para `tempo_bpm` y 88.2 mil para `seguidores_miles`: esos valores reemplazan cualquier faltante que llegue\n",
    "después, en test o en producción.\n",
    "\n",
    "## 7. ¿Qué pasa si se preprocesa antes de partir?\n",
    "\n",
    "El error clásico: imputar y escalar con **todo** el dataset y después partir. Así la mediana y la media incluyen las\n",
    "canciones de test. Se compara contra el pipeline correcto:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "621b20d1",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.677716Z",
     "iopub.status.busy": "2026-10-18T17:51:16.677178Z",
     "iopub.status.idle": "2026-10-18T17:51:16.746055Z",
     "shell.execute_reply": "2026-10-18T17:51:16.744441Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "preprocesar antes de partir -> AUC test: 0.8476\n",
      "pipeline correcto           -> AUC test: 0.8474\n"
     ]
    }
   ],
   "source": [
    "from sklearn.pipeline import make_pipeline\n",
    "\n",
    "num_todo = Pipeline([(\"imputar\", SimpleImputer(strategy=\"median\")), (\"escalar\", StandardScaler())])\n",
    "X_fuga = pd.DataFrame(num_todo.fit_transform(limpio[NUMERICAS]), columns=NUMERICAS)   # ajustado con TODO\n",
    "X_fuga[\"genero\"] = limpio[\"genero\"]\n",
    "A_tr, A_te, b_tr, b_te = train_test_split(X_fuga, y, test_size=0.25, stratify=y, random_state=42)\n",
    "con_fuga = make_pipeline(ColumnTransformer([(\"num\", \"passthrough\", NUMERICAS),\n",
    "                                            (\"cat\", OneHotEncoder(handle_unknown=\"ignore\"), CATEGORICAS)]),\n",
    "                         LogisticRegression(max_iter=2000)).fit(A_tr, b_tr)\n",
    "\n",
    "print(\"preprocesar antes de partir -> AUC test:\", round(roc_auc_score(b_te, con_fuga.predict_proba(A_te)[:, 1]), 4))\n",
    "print(\"pipeline correcto           -> AUC test:\", round(roc_auc_score(y_te, pipe.predict_proba(X_te)[:, 1]), 4))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c6d5f614",
   "metadata": {},
   "source": [
    "0.8476 contra 0.8474: aquí la diferencia es mínima. Con 1500 canciones, la mediana y la desviación casi no cambian\n",
    "por incluir el test, así que esta fuga en particular apenas infla la cifra. Que el número salga parecido no vuelve\n",
    "correcto el procedimiento: en producción no tendrás el test para calcular la mediana, y la cifra reportada debe\n",
    "salir del mismo proceso que usarás después.\n",
    "\n",
    "La fuga se vuelve grave cuando el paso que se ajusta con todo **aprende de `y`**. El caso típico es la selección de\n",
    "características. Con 1000 columnas de puro ruido (no tienen ninguna relación con `top50`), se eligen las 20 «mejores»\n",
    "con todo el dataset y después se valida, contra hacer la selección dentro del pipeline:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "44f61f49",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:16.750089Z",
     "iopub.status.busy": "2026-10-18T17:51:16.749550Z",
     "iopub.status.idle": "2026-10-18T17:51:17.338926Z",
     "shell.execute_reply": "2026-10-18T17:51:17.337920Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "selección con todo el dataset -> AUC CV: 0.688\n",
      "selección dentro del pipeline -> AUC CV: 0.54\n"
     ]
    }
   ],
   "source": [
    "from sklearn.feature_selection import SelectKBest, f_classif\n",
    "from sklearn.model_selection import StratifiedKFold, cross_val_score\n",
    "\n",
    "ruido = pd.DataFrame(np.random.default_rng(0).normal(size=(len(y), 1000)))\n",
    "cv = StratifiedKFold(5, shuffle=True, random_state=42)\n",
    "\n",
    "elegidas = SelectKBest(f_classif, k=20).fit(ruido, y).get_support()          # mira y de TODAS las filas\n",
    "fuera = cross_val_score(LogisticRegression(max_iter=2000), ruido.loc[:, elegidas], y, cv=cv, scoring=\"roc_auc\")\n",
    "dentro = cross_val_score(make_pipeline(SelectKBest(f_classif, k=20), LogisticRegression(max_iter=2000)),\n",
    "                         ruido, y, cv=cv, scoring=\"roc_auc\")\n",
    "print(\"selección con todo el dataset -> AUC CV:\", round(fuera.mean(), 3))\n",
    "print(\"selección dentro del pipeline -> AUC CV:\", round(dentro.mean(), 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "769aa8b2",
   "metadata": {},
   "source": [
    "Elegir con todo el dataset da un AUC de **0.688** con puro ruido: parece que esas 20 columnas predicen el Top 50.\n",
    "Dentro del pipeline, el mismo ruido da 0.54, cerca del 0.5 del azar, que es la verdad. Por eso la regla es una sola: todo lo que\n",
    "aprende de los datos va dentro del pipeline, y así la validación cruzada lo repite en cada pliegue.\n",
    "\n",
    "## 8. Nombres de columnas y salida en pandas\n",
    "\n",
    "Después de `pre`, las 10 columnas de entrada se convierten en 14: 9 numéricas escaladas y 5 columnas de género."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "0ecb01c3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:17.341927Z",
     "iopub.status.busy": "2026-10-18T17:51:17.341927Z",
     "iopub.status.idle": "2026-10-18T17:51:17.349142Z",
     "shell.execute_reply": "2026-10-18T17:51:17.348134Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "14 columnas: ['num__energia', 'num__bailabilidad', 'num__acustica', 'num__tempo_bpm', 'num__duracion_seg', 'num__seguidores_miles', 'num__colaboracion', 'num__explicita', 'num__en_playlist', 'cat__genero_electrónica', 'cat__genero_pop', 'cat__genero_regional', 'cat__genero_reguetón', 'cat__genero_rock']\n"
     ]
    }
   ],
   "source": [
    "nombres = pipe.named_steps[\"pre\"].get_feature_names_out()\n",
    "print(len(nombres), \"columnas:\", list(nombres))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "027af41f",
   "metadata": {},
   "source": [
    "Por omisión `transform` devuelve un arreglo de NumPy sin nombres. Con `set_output(transform=\"pandas\")` devuelve un\n",
    "DataFrame, útil para revisar qué le llega al modelo:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7618b2b2",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:17.353656Z",
     "iopub.status.busy": "2026-10-18T17:51:17.352647Z",
     "iopub.status.idle": "2026-10-18T17:51:17.429442Z",
     "shell.execute_reply": "2026-10-18T17:51:17.427430Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                         1056  107   1210\n",
      "num__energia            -1.14  0.81  1.01\n",
      "num__bailabilidad       -1.38  1.61  0.40\n",
      "num__acustica           -0.38  0.05 -0.62\n",
      "num__tempo_bpm          -0.41 -0.80  0.59\n",
      "num__duracion_seg        2.92 -0.25 -0.25\n",
      "num__seguidores_miles   -0.07 -0.14 -0.31\n",
      "num__colaboracion       -0.61  1.65 -0.61\n",
      "num__explicita          -0.55 -0.55 -0.55\n",
      "num__en_playlist         1.53  1.53 -0.66\n",
      "cat__genero_electrónica  0.00  0.00  0.00\n",
      "cat__genero_pop          1.00  1.00  0.00\n",
      "cat__genero_regional     0.00  0.00  1.00\n",
      "cat__genero_reguetón     0.00  0.00  0.00\n",
      "cat__genero_rock         0.00  0.00  0.00\n"
     ]
    },
    {
     "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",
       "    border: none;\n",
       "    padding: 0;\n",
       "    background-color: transparent;\n",
       "}\n",
       "\n",
       ".copy-paste-icon:focus-visible {\n",
       "    outline: 1px solid currentColor;\n",
       "    outline-offset: 1px;\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-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-2\" tabindex=\"0\" class=\"sk-top-container sk-global\"><div class=\"sk-text-repr-fallback\"><pre>ColumnTransformer(transformers=[(&#x27;num&#x27;,\n",
       "                                 Pipeline(steps=[(&#x27;imputar&#x27;,\n",
       "                                                  SimpleImputer(strategy=&#x27;median&#x27;)),\n",
       "                                                 (&#x27;escalar&#x27;,\n",
       "                                                  StandardScaler())]),\n",
       "                                 [&#x27;energia&#x27;, &#x27;bailabilidad&#x27;, &#x27;acustica&#x27;,\n",
       "                                  &#x27;tempo_bpm&#x27;, &#x27;duracion_seg&#x27;,\n",
       "                                  &#x27;seguidores_miles&#x27;, &#x27;colaboracion&#x27;,\n",
       "                                  &#x27;explicita&#x27;, &#x27;en_playlist&#x27;]),\n",
       "                                (&#x27;cat&#x27;,\n",
       "                                 Pipeline(steps=[(&#x27;imputar&#x27;,\n",
       "                                                  SimpleImputer(strategy=&#x27;most_frequent&#x27;)),\n",
       "                                                 (&#x27;onehot&#x27;,\n",
       "                                                  OneHotEncoder(handle_unknown=&#x27;ignore&#x27;,\n",
       "                                                                sparse_output=False))]),\n",
       "                                 [&#x27;genero&#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-8\" type=\"checkbox\" ><label for=\"sk-estimator-id-8\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>ColumnTransformer</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html\">?<span>Documentation for ColumnTransformer</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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy transformers to clipboard\"\n",
       "                 onclick=\"copyToClipboard('transformers',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-transformers;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=transformers,-list%20of%20tuples\">\n",
       "            transformers\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-transformers;\">\n",
       "            transformers: list of tuples<br><br>List of (name, transformer, columns) tuples specifying the<br>transformer objects to be applied to subsets of the data.<br><br>name : str<br>    Like in Pipeline and FeatureUnion, this allows the transformer and<br>    its parameters to be set using ``set_params`` and searched in grid<br>    search.<br>transformer : {&#x27;drop&#x27;, &#x27;passthrough&#x27;} or estimator<br>    Estimator must support :term:`fit` and :term:`transform`.<br>    Special-cased strings &#x27;drop&#x27; and &#x27;passthrough&#x27; are accepted as<br>    well, to indicate to drop the columns or to pass them through<br>    untransformed, respectively.<br>columns :  str, array-like of str, int, array-like of int,                 array-like of bool, slice or callable<br>    Indexes the data on its second axis. Integers are interpreted as<br>    positional columns, while strings can reference DataFrame columns<br>    by name.  A scalar string or int should be used where<br>    ``transformer`` expects X to be a 1d array-like (vector),<br>    otherwise a 2d array will be passed to the transformer.<br>    A callable is passed the input data `X` and can return any of the<br>    above. To select multiple columns by name or dtype, you can use<br>    :obj:`make_column_selector`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">[(&#x27;num&#x27;, ...), (&#x27;cat&#x27;, ...)]</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy remainder to clipboard\"\n",
       "                 onclick=\"copyToClipboard('remainder',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-remainder;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=remainder,-%7B%27drop%27%2C%20%27passthrough%27%7D%20or%20estimator%2C%20default%3D%27drop%27\">\n",
       "            remainder\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-remainder;\">\n",
       "            remainder: {&#x27;drop&#x27;, &#x27;passthrough&#x27;} or estimator, default=&#x27;drop&#x27;<br><br>By default, only the specified columns in `transformers` are<br>transformed and combined in the output, and the non-specified<br>columns are dropped. (default of ``&#x27;drop&#x27;``).<br>By specifying ``remainder=&#x27;passthrough&#x27;``, all remaining columns that<br>were not specified in `transformers`, but present in the data passed<br>to `fit` will be automatically passed through. This subset of columns<br>is concatenated with the output of the transformers. For dataframes,<br>extra columns not seen during `fit` will be excluded from the output<br>of `transform`.<br>By setting ``remainder`` to be an estimator, the remaining<br>non-specified columns will use the ``remainder`` estimator. The<br>estimator must support :term:`fit` and :term:`transform`.<br>Note that using this feature requires that the DataFrame columns<br>input at :term:`fit` and :term:`transform` have identical order.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;drop&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy sparse_threshold to clipboard\"\n",
       "                 onclick=\"copyToClipboard('sparse_threshold',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-sparse_threshold;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=sparse_threshold,-float%2C%20default%3D0.3\">\n",
       "            sparse_threshold\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-sparse_threshold;\">\n",
       "            sparse_threshold: float, default=0.3<br><br>If the output of the different transformers contains sparse matrices,<br>these will be stacked as a sparse matrix if the overall density is<br>lower than this value. Use ``sparse_threshold=0`` to always return<br>dense.  When the transformed output consists of all dense data, the<br>stacked result will be dense, and this keyword will be ignored.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">0.3</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy n_jobs to clipboard\"\n",
       "                 onclick=\"copyToClipboard('n_jobs',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></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.compose.ColumnTransformer.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.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy transformer_weights to clipboard\"\n",
       "                 onclick=\"copyToClipboard('transformer_weights',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-transformer_weights;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=transformer_weights,-dict%2C%20default%3DNone\">\n",
       "            transformer_weights\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-transformer_weights;\">\n",
       "            transformer_weights: dict, default=None<br><br>Multiplicative weights for features per transformer. The output of the<br>transformer is multiplied by these weights. Keys are transformer names,<br>values the weights.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy verbose to clipboard\"\n",
       "                 onclick=\"copyToClipboard('verbose',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></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.compose.ColumnTransformer.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>If True, the time elapsed while fitting each transformer will be<br>printed as it is completed.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy verbose_feature_names_out to clipboard\"\n",
       "                 onclick=\"copyToClipboard('verbose_feature_names_out',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-verbose_feature_names_out;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=verbose_feature_names_out,-bool%2C%20str%20or%20Callable%5B%5Bstr%2C%20str%5D%2C%20str%5D%2C%20default%3DTrue\">\n",
       "            verbose_feature_names_out\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-verbose_feature_names_out;\">\n",
       "            verbose_feature_names_out: bool, str or Callable[[str, str], str], default=True<br><br>- If True, :meth:`ColumnTransformer.get_feature_names_out` will prefix<br>  all feature names with the name of the transformer that generated that<br>  feature. It is equivalent to setting<br>  `verbose_feature_names_out=&quot;{transformer_name}__{feature_name}&quot;`.<br>- If False, :meth:`ColumnTransformer.get_feature_names_out` will not<br>  prefix any feature names and will error if feature names are not<br>  unique.<br>- If ``Callable[[str, str], str]``,<br>  :meth:`ColumnTransformer.get_feature_names_out` will rename all the features<br>  using the name of the transformer. The first argument of the callable is the<br>  transformer name and the second argument is the feature name. The returned<br>  string will be the new feature name.<br>- If ``str``, it must be a string ready for formatting. The given string will<br>  be formatted using two field names: ``transformer_name`` and ``feature_name``.<br>  e.g. ``&quot;{feature_name}__{transformer_name}&quot;``. See :meth:`str.format` method<br>  from the standard library for more info.<br><br>.. versionadded:: 1.0<br><br>.. versionchanged:: 1.6<br>    `verbose_feature_names_out` can be a callable or a string to be formatted.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</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-feature_names_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=feature_names_in_,-ndarray%20of%20shape%20%28n_features_in_%2C%29\">\n",
       "            feature_names_in_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-feature_names_in_;\">\n",
       "            feature_names_in_: ndarray of shape (`n_features_in_`,)<br><br>Names of features seen during :term:`fit`. Defined only when `X`<br>has feature names that are all strings.<br><br>.. versionadded:: 1.0</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[object](10,)</td>\n",
       "           <td>[&#x27;energia&#x27;,&#x27;bailabilidad&#x27;,&#x27;acustica&#x27;,...,&#x27;explicita&#x27;,&#x27;en_playlist&#x27;,\n",
       " &#x27;genero&#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-n_features_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.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 the<br>underlying transformers expose such an attribute when fit.<br><br>.. versionadded:: 0.24</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>10</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-named_transformers_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=named_transformers_,-%3Aclass%3A~sklearn.utils.Bunch\">\n",
       "            named_transformers_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-named_transformers_;\">\n",
       "            named_transformers_: :class:`~sklearn.utils.Bunch`<br><br>Read-only attribute to access any transformer by given name.<br>Keys are transformer names and values are the fitted transformer<br>objects.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">Bunch</td>\n",
       "           <td>{&#x27;num&#x27;: Pipel...put=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-output_indices_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=output_indices_,-dict\">\n",
       "            output_indices_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-output_indices_;\">\n",
       "            output_indices_: dict<br><br>A dictionary from each transformer name to a slice, where the slice<br>corresponds to indices in the transformed output. This is useful to<br>inspect which transformer is responsible for which transformed<br>feature(s).<br><br>.. versionadded:: 1.0</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">dict</td>\n",
       "           <td>{&#x27;cat&#x27;: slice(9, 14, None), &#x27;num&#x27;: slice(0, 9, None), &#x27;re...er&#x27;: slice(0, 0, None)}</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-sparse_output_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=sparse_output_,-bool\">\n",
       "            sparse_output_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-sparse_output_;\">\n",
       "            sparse_output_: bool<br><br>Boolean flag indicating whether the output of ``transform`` is a<br>sparse matrix or a dense numpy array, which depends on the output<br>of the individual transformers and the `sparse_threshold` keyword.</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-transformers_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.compose.ColumnTransformer.html#:~:text=transformers_,-list\">\n",
       "            transformers_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-transformers_;\">\n",
       "            transformers_: list<br><br>The collection of fitted transformers as tuples of (name,<br>fitted_transformer, column). `fitted_transformer` can be an estimator,<br>or `&#x27;drop&#x27;`; `&#x27;passthrough&#x27;` is replaced with an equivalent<br>:class:`~sklearn.preprocessing.FunctionTransformer`. In case there were<br>no columns selected, this will be the unfitted transformer. If there<br>are remaining columns, the final element is a tuple of the form:<br>(&#x27;remainder&#x27;, transformer, remaining_columns) corresponding to the<br>``remainder`` parameter. If there are remaining columns, then<br>``len(transformers_)==len(transformers)+1``, otherwise<br>``len(transformers_)==len(transformers)``.<br><br>.. versionadded:: 1.7<br>    The format of the remaining columns now attempts to match that of the other<br>    transformers: if all columns were provided as column names (`str`), the<br>    remaining columns are stored as column names; if all columns were provided<br>    as mask arrays (`bool`), so are the remaining columns; in all other cases<br>    the remaining columns are stored as indices (`int`).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">list</td>\n",
       "           <td>[(&#x27;num&#x27;, Pipeline(step...ardScaler())]), [&#x27;energia&#x27;, &#x27;ba...ad&#x27;, &#x27;ac...ca&#x27;, &#x27;te...pm&#x27;, ...]), (&#x27;cat&#x27;, Pipeline(step...tput=False))]), [&#x27;genero&#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-9\" type=\"checkbox\" ><label for=\"sk-estimator-id-9\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>num</div></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"num__\"><pre>[&#x27;energia&#x27;, &#x27;bailabilidad&#x27;, &#x27;acustica&#x27;, &#x27;tempo_bpm&#x27;, &#x27;duracion_seg&#x27;, &#x27;seguidores_miles&#x27;, &#x27;colaboracion&#x27;, &#x27;explicita&#x27;, &#x27;en_playlist&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><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-10\" type=\"checkbox\" ><label for=\"sk-estimator-id-10\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>SimpleImputer</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html\">?<span>Documentation for SimpleImputer</span></a></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"num__imputar__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy strategy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('strategy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-strategy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=strategy,-str%20or%20Callable%2C%20default%3D%27mean%27\">\n",
       "            strategy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-strategy;\">\n",
       "            strategy: str or Callable, default=&#x27;mean&#x27;<br><br>The imputation strategy.<br><br>- If &quot;mean&quot;, then replace missing values using the mean along<br>  each column. Can only be used with numeric data.<br>- If &quot;median&quot;, then replace missing values using the median along<br>  each column. Can only be used with numeric data.<br>- If &quot;most_frequent&quot;, then replace missing using the most frequent<br>  value along each column. Can be used with strings or numeric data.<br>  If there is more than one such value, only the smallest is returned.<br>- If &quot;constant&quot;, then replace missing values with fill_value. Can be<br>  used with strings or numeric data.<br>- If an instance of Callable, then replace missing values using the<br>  scalar statistic returned by running the callable over a dense 1d<br>  array containing non-missing values of each column.<br><br>.. versionadded:: 0.20<br>   strategy=&quot;constant&quot; for fixed value imputation.<br><br>.. versionadded:: 1.5<br>   strategy=callable for custom value imputation.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;median&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy missing_values to clipboard\"\n",
       "                 onclick=\"copyToClipboard('missing_values',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-missing_values;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=missing_values,-int%2C%20float%2C%20str%2C%20np.nan%2C%20None%20or%20pandas.NA%2C%20default%3Dnp.nan\">\n",
       "            missing_values\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-missing_values;\">\n",
       "            missing_values: int, float, str, np.nan, None or pandas.NA, default=np.nan<br><br>The placeholder for the missing values. All occurrences of<br>`missing_values` will be imputed. For pandas&#x27; dataframes with<br>nullable integer dtypes with missing values, `missing_values`<br>can be set to either `np.nan` or `pd.NA`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">nan</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy fill_value to clipboard\"\n",
       "                 onclick=\"copyToClipboard('fill_value',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-fill_value;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=fill_value,-str%20or%20numerical%20value%2C%20default%3DNone\">\n",
       "            fill_value\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-fill_value;\">\n",
       "            fill_value: str or numerical value, default=None<br><br>When strategy == &quot;constant&quot;, `fill_value` is used to replace all<br>occurrences of missing_values. For string or object data types,<br>`fill_value` must be a string.<br>If `None`, `fill_value` will be 0 when imputing numerical<br>data and &quot;missing_value&quot; for strings or object data types.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If True, a copy of X will be created. If False, imputation will<br>be done in-place whenever possible. Note that, in the following cases,<br>a new copy will always be made, even if `copy=False`:<br><br>- If `X` is not an array of floating values;<br>- If `X` is encoded as a CSR matrix;<br>- If `add_indicator=True`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy add_indicator to clipboard\"\n",
       "                 onclick=\"copyToClipboard('add_indicator',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-add_indicator;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=add_indicator,-bool%2C%20default%3DFalse\">\n",
       "            add_indicator\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-add_indicator;\">\n",
       "            add_indicator: bool, default=False<br><br>If True, a :class:`MissingIndicator` transform will stack onto output<br>of the imputer&#x27;s transform. This allows a predictive estimator<br>to account for missingness despite imputation. If a feature has no<br>missing values at fit/train time, the feature won&#x27;t appear on<br>the missing indicator even if there are missing values at<br>transform/test time.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy keep_empty_features to clipboard\"\n",
       "                 onclick=\"copyToClipboard('keep_empty_features',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-keep_empty_features;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=keep_empty_features,-bool%2C%20default%3DFalse\">\n",
       "            keep_empty_features\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-keep_empty_features;\">\n",
       "            keep_empty_features: bool, default=False<br><br>If True, features that consist exclusively of missing values when<br>`fit` is called are returned in results when `transform` is called.<br>The imputed value is always `0` except when `strategy=&quot;constant&quot;`<br>in which case `fill_value` will be used instead.<br><br>.. versionadded:: 1.2</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-feature_names_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=feature_names_in_,-ndarray%20of%20shape%20%28n_features_in_%2C%29\">\n",
       "            feature_names_in_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-feature_names_in_;\">\n",
       "            feature_names_in_: ndarray of shape (`n_features_in_`,)<br><br>Names of features seen during :term:`fit`. Defined only when `X`<br>has feature names that are all strings.<br><br>.. versionadded:: 1.0</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[object](9,)</td>\n",
       "           <td>[&#x27;energia&#x27;,&#x27;bailabilidad&#x27;,&#x27;acustica&#x27;,...,&#x27;colaboracion&#x27;,&#x27;explicita&#x27;,\n",
       " &#x27;en_playlist&#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-indicator_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=indicator_,-%3Aclass%3A~sklearn.impute.MissingIndicator\">\n",
       "            indicator_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-indicator_;\">\n",
       "            indicator_: :class:`~sklearn.impute.MissingIndicator`<br><br>Indicator used to add binary indicators for missing values.<br>`None` if `add_indicator=False`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">NoneType</td>\n",
       "           <td>None</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.impute.SimpleImputer.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>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-statistics_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=statistics_,-array%20of%20shape%20%28n_features%2C%29\">\n",
       "            statistics_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-statistics_;\">\n",
       "            statistics_: array of shape (n_features,)<br><br>The imputation fill value for each feature.<br>Computing statistics can result in `np.nan` values.<br>During :meth:`transform`, features corresponding to `np.nan`<br>statistics will be discarded.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](9,)</td>\n",
       "           <td>[0.66,0.5 ,0.2 ,...,0.  ,0.  ,0.  ]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div>\n",
       "        <div class=\"features fitted\">\n",
       "          <details>\n",
       "            <summary>\n",
       "              <div class=\"arrow\"></div>\n",
       "              <div>9 features</div>\n",
       "              <div class=\"image-container\">\n",
       "                <button type=\"button\" class=\"copy-paste-icon\"\n",
       "                  title=\"Copy output features (max 100)\"\n",
       "                  aria-label=\"Copy output features (max 100)\"\n",
       "                  onclick=\"\n",
       "                  event.stopPropagation();\n",
       "                  event.preventDefault();\n",
       "                  copyFeatureNamesToClipboard(this);\n",
       "                  \"\n",
       "                >\n",
       "                </button>\n",
       "              </div>\n",
       "            </summary>\n",
       "            <div class=\"features-container\">\n",
       "                <table class=\"features-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr>\n",
       "          <td>energia</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>bailabilidad</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>acustica</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>tempo_bpm</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>duracion_seg</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>seguidores_miles</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>colaboracion</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>explicita</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>en_playlist</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </div>\n",
       "          </details>\n",
       "        </div>\n",
       "    <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-11\" type=\"checkbox\" ><label for=\"sk-estimator-id-11\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>StandardScaler</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html\">?<span>Documentation for StandardScaler</span></a></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"num__escalar__\">\n",
       "        <div class=\"estimator-table\">\n",
       "            <details>\n",
       "                <summary>Parameters</summary>\n",
       "                <table class=\"parameters-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If False, try to avoid a copy and do inplace scaling instead.<br>This is not guaranteed to always work inplace; e.g. if the data is<br>not a NumPy array or scipy.sparse CSR matrix, a copy may still be<br>returned.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy with_mean to clipboard\"\n",
       "                 onclick=\"copyToClipboard('with_mean',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-with_mean;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=with_mean,-bool%2C%20default%3DTrue\">\n",
       "            with_mean\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-with_mean;\">\n",
       "            with_mean: bool, default=True<br><br>If True, center the data before scaling.<br>This does not work (and will raise an exception) when attempted on<br>sparse matrices, because centering them entails building a dense<br>matrix which in common use cases is likely to be too large to fit in<br>memory.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy with_std to clipboard\"\n",
       "                 onclick=\"copyToClipboard('with_std',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-with_std;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=with_std,-bool%2C%20default%3DTrue\">\n",
       "            with_std\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-with_std;\">\n",
       "            with_std: bool, default=True<br><br>If True, scale the data to unit variance (or equivalently,<br>unit standard deviation).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</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-mean_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=mean_,-ndarray%20of%20shape%20%28n_features%2C%29%20or%20None\">\n",
       "            mean_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-mean_;\">\n",
       "            mean_: ndarray of shape (n_features,) or None<br><br>The mean value for each feature in the training set.<br>Equal to ``None`` when ``with_mean=False`` and ``with_std=False``.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](9,)</td>\n",
       "           <td>[0.61,0.56,0.31,...,0.27,0.23,0.3 ]</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.preprocessing.StandardScaler.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>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-n_samples_seen_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=n_samples_seen_,-int%20or%20ndarray%20of%20shape%20%28n_features%2C%29\">\n",
       "            n_samples_seen_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-n_samples_seen_;\">\n",
       "            n_samples_seen_: int or ndarray of shape (n_features,)<br><br>The number of samples processed by the estimator for each feature.<br>If there are no missing samples, the ``n_samples_seen`` will be an<br>integer, otherwise it will be an array of dtype int. If<br>`sample_weights` are used it will be a float (if no missing data)<br>or an array of dtype float that sums the weights seen so far.<br>Will be reset on new calls to fit, but increments across<br>``partial_fit`` calls.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">float64</td>\n",
       "           <td>1125</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-scale_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=scale_,-ndarray%20of%20shape%20%28n_features%2C%29%20or%20None\">\n",
       "            scale_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-scale_;\">\n",
       "            scale_: ndarray of shape (n_features,) or None<br><br>Per feature relative scaling of the data to achieve zero mean and unit<br>variance. Generally this is calculated using `np.sqrt(var_)`. If a<br>variance is zero, we can&#x27;t achieve unit variance, and the data is left<br>as-is, giving a scaling factor of 1. `scale_` is equal to `None`<br>when `with_std=False`.<br><br>.. versionadded:: 0.17<br>   *scale_*</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](9,)</td>\n",
       "           <td>[0.24,0.2 ,0.28,...,0.44,0.42,0.46]</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-var_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.StandardScaler.html#:~:text=var_,-ndarray%20of%20shape%20%28n_features%2C%29%20or%20None\">\n",
       "            var_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-var_;\">\n",
       "            var_: ndarray of shape (n_features,) or None<br><br>The variance for each feature in the training set. Used to compute<br>`scale_`. Equal to ``None`` when ``with_mean=False`` and<br>``with_std=False``.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[float64](9,)</td>\n",
       "           <td>[0.06,0.04,0.08,...,0.2 ,0.18,0.21]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div>\n",
       "        <div class=\"features fitted\">\n",
       "          <details>\n",
       "            <summary>\n",
       "              <div class=\"arrow\"></div>\n",
       "              <div>9 features</div>\n",
       "              <div class=\"image-container\">\n",
       "                <button type=\"button\" class=\"copy-paste-icon\"\n",
       "                  title=\"Copy output features (max 100)\"\n",
       "                  aria-label=\"Copy output features (max 100)\"\n",
       "                  onclick=\"\n",
       "                  event.stopPropagation();\n",
       "                  event.preventDefault();\n",
       "                  copyFeatureNamesToClipboard(this);\n",
       "                  \"\n",
       "                >\n",
       "                </button>\n",
       "              </div>\n",
       "            </summary>\n",
       "            <div class=\"features-container\">\n",
       "                <table class=\"features-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr>\n",
       "          <td>x0</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x1</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x2</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x3</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x4</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x5</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x6</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x7</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x8</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </div>\n",
       "          </details>\n",
       "        </div>\n",
       "    </div></div></div></div></div><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-12\" type=\"checkbox\" ><label for=\"sk-estimator-id-12\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>cat</div></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"cat__\"><pre>[&#x27;genero&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><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-13\" type=\"checkbox\" ><label for=\"sk-estimator-id-13\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>SimpleImputer</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html\">?<span>Documentation for SimpleImputer</span></a></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"cat__imputar__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy strategy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('strategy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-strategy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=strategy,-str%20or%20Callable%2C%20default%3D%27mean%27\">\n",
       "            strategy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-strategy;\">\n",
       "            strategy: str or Callable, default=&#x27;mean&#x27;<br><br>The imputation strategy.<br><br>- If &quot;mean&quot;, then replace missing values using the mean along<br>  each column. Can only be used with numeric data.<br>- If &quot;median&quot;, then replace missing values using the median along<br>  each column. Can only be used with numeric data.<br>- If &quot;most_frequent&quot;, then replace missing using the most frequent<br>  value along each column. Can be used with strings or numeric data.<br>  If there is more than one such value, only the smallest is returned.<br>- If &quot;constant&quot;, then replace missing values with fill_value. Can be<br>  used with strings or numeric data.<br>- If an instance of Callable, then replace missing values using the<br>  scalar statistic returned by running the callable over a dense 1d<br>  array containing non-missing values of each column.<br><br>.. versionadded:: 0.20<br>   strategy=&quot;constant&quot; for fixed value imputation.<br><br>.. versionadded:: 1.5<br>   strategy=callable for custom value imputation.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;most_frequent&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy missing_values to clipboard\"\n",
       "                 onclick=\"copyToClipboard('missing_values',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-missing_values;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=missing_values,-int%2C%20float%2C%20str%2C%20np.nan%2C%20None%20or%20pandas.NA%2C%20default%3Dnp.nan\">\n",
       "            missing_values\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-missing_values;\">\n",
       "            missing_values: int, float, str, np.nan, None or pandas.NA, default=np.nan<br><br>The placeholder for the missing values. All occurrences of<br>`missing_values` will be imputed. For pandas&#x27; dataframes with<br>nullable integer dtypes with missing values, `missing_values`<br>can be set to either `np.nan` or `pd.NA`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">nan</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy fill_value to clipboard\"\n",
       "                 onclick=\"copyToClipboard('fill_value',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-fill_value;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=fill_value,-str%20or%20numerical%20value%2C%20default%3DNone\">\n",
       "            fill_value\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-fill_value;\">\n",
       "            fill_value: str or numerical value, default=None<br><br>When strategy == &quot;constant&quot;, `fill_value` is used to replace all<br>occurrences of missing_values. For string or object data types,<br>`fill_value` must be a string.<br>If `None`, `fill_value` will be 0 when imputing numerical<br>data and &quot;missing_value&quot; for strings or object data types.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy copy to clipboard\"\n",
       "                 onclick=\"copyToClipboard('copy',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-copy;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=copy,-bool%2C%20default%3DTrue\">\n",
       "            copy\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-copy;\">\n",
       "            copy: bool, default=True<br><br>If True, a copy of X will be created. If False, imputation will<br>be done in-place whenever possible. Note that, in the following cases,<br>a new copy will always be made, even if `copy=False`:<br><br>- If `X` is not an array of floating values;<br>- If `X` is encoded as a CSR matrix;<br>- If `add_indicator=True`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">True</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy add_indicator to clipboard\"\n",
       "                 onclick=\"copyToClipboard('add_indicator',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-add_indicator;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=add_indicator,-bool%2C%20default%3DFalse\">\n",
       "            add_indicator\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-add_indicator;\">\n",
       "            add_indicator: bool, default=False<br><br>If True, a :class:`MissingIndicator` transform will stack onto output<br>of the imputer&#x27;s transform. This allows a predictive estimator<br>to account for missingness despite imputation. If a feature has no<br>missing values at fit/train time, the feature won&#x27;t appear on<br>the missing indicator even if there are missing values at<br>transform/test time.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy keep_empty_features to clipboard\"\n",
       "                 onclick=\"copyToClipboard('keep_empty_features',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-keep_empty_features;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=keep_empty_features,-bool%2C%20default%3DFalse\">\n",
       "            keep_empty_features\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-keep_empty_features;\">\n",
       "            keep_empty_features: bool, default=False<br><br>If True, features that consist exclusively of missing values when<br>`fit` is called are returned in results when `transform` is called.<br>The imputed value is always `0` except when `strategy=&quot;constant&quot;`<br>in which case `fill_value` will be used instead.<br><br>.. versionadded:: 1.2</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-feature_names_in_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=feature_names_in_,-ndarray%20of%20shape%20%28n_features_in_%2C%29\">\n",
       "            feature_names_in_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-feature_names_in_;\">\n",
       "            feature_names_in_: ndarray of shape (`n_features_in_`,)<br><br>Names of features seen during :term:`fit`. Defined only when `X`<br>has feature names that are all strings.<br><br>.. versionadded:: 1.0</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[object](1,)</td>\n",
       "           <td>[&#x27;genero&#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-indicator_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=indicator_,-%3Aclass%3A~sklearn.impute.MissingIndicator\">\n",
       "            indicator_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-indicator_;\">\n",
       "            indicator_: :class:`~sklearn.impute.MissingIndicator`<br><br>Indicator used to add binary indicators for missing values.<br>`None` if `add_indicator=False`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">NoneType</td>\n",
       "           <td>None</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.impute.SimpleImputer.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>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-statistics_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.impute.SimpleImputer.html#:~:text=statistics_,-array%20of%20shape%20%28n_features%2C%29\">\n",
       "            statistics_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-statistics_;\">\n",
       "            statistics_: array of shape (n_features,)<br><br>The imputation fill value for each feature.<br>Computing statistics can result in `np.nan` values.<br>During :meth:`transform`, features corresponding to `np.nan`<br>statistics will be discarded.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">ndarray[object](1,)</td>\n",
       "           <td>[&#x27;pop&#x27;]</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div>\n",
       "        <div class=\"features fitted\">\n",
       "          <details>\n",
       "            <summary>\n",
       "              <div class=\"arrow\"></div>\n",
       "              <div>1 feature</div>\n",
       "              <div class=\"image-container\">\n",
       "                <button type=\"button\" class=\"copy-paste-icon\"\n",
       "                  title=\"Copy output features (max 100)\"\n",
       "                  aria-label=\"Copy output features (max 100)\"\n",
       "                  onclick=\"\n",
       "                  event.stopPropagation();\n",
       "                  event.preventDefault();\n",
       "                  copyFeatureNamesToClipboard(this);\n",
       "                  \"\n",
       "                >\n",
       "                </button>\n",
       "              </div>\n",
       "            </summary>\n",
       "            <div class=\"features-container\">\n",
       "                <table class=\"features-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr>\n",
       "          <td>genero</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </div>\n",
       "          </details>\n",
       "        </div>\n",
       "    <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-14\" type=\"checkbox\" ><label for=\"sk-estimator-id-14\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>OneHotEncoder</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html\">?<span>Documentation for OneHotEncoder</span></a></div></label><div class=\"sk-toggleable__content fitted\" data-param-prefix=\"cat__onehot__\">\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><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy sparse_output to clipboard\"\n",
       "                 onclick=\"copyToClipboard('sparse_output',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-sparse_output;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=sparse_output,-bool%2C%20default%3DTrue\">\n",
       "            sparse_output\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-sparse_output;\">\n",
       "            sparse_output: bool, default=True<br><br>When ``True``, it returns a SciPy sparse matrix/array<br>in &quot;Compressed Sparse Row&quot; (CSR) format.<br><br>.. versionadded:: 1.2<br>   `sparse` was renamed to `sparse_output`</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">False</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"user-set\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy handle_unknown to clipboard\"\n",
       "                 onclick=\"copyToClipboard('handle_unknown',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-handle_unknown;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=handle_unknown,-%7B%27error%27%2C%20%27ignore%27%2C%20%27infrequent_if_exist%27%2C%20%27warn%27%7D%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3D%27error%27\">\n",
       "            handle_unknown\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-handle_unknown;\">\n",
       "            handle_unknown: {&#x27;error&#x27;, &#x27;ignore&#x27;, &#x27;infrequent_if_exist&#x27;, &#x27;warn&#x27;},                      default=&#x27;error&#x27;<br><br>Specifies the way unknown categories are handled during :meth:`transform`.<br><br>- &#x27;error&#x27; : Raise an error if an unknown category is present during transform.<br>- &#x27;ignore&#x27; : When an unknown category is encountered during<br>  transform, the resulting one-hot encoded columns for this feature<br>  will be all zeros. In the inverse transform, an unknown category<br>  will be denoted as None.<br>- &#x27;infrequent_if_exist&#x27; : When an unknown category is encountered<br>  during transform, the resulting one-hot encoded columns for this<br>  feature will map to the infrequent category if it exists. The<br>  infrequent category will be mapped to the last position in the<br>  encoding. During inverse transform, an unknown category will be<br>  mapped to the category denoted `&#x27;infrequent&#x27;` if it exists. If the<br>  `&#x27;infrequent&#x27;` category does not exist, then :meth:`transform` and<br>  :meth:`inverse_transform` will handle an unknown category as with<br>  `handle_unknown=&#x27;ignore&#x27;`. Infrequent categories exist based on<br>  `min_frequency` and `max_categories`. Read more in the<br>  :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.<br>- &#x27;warn&#x27; : When an unknown category is encountered during transform<br>  a warning is issued, and the encoding then proceeds as described for<br>  `handle_unknown=&quot;infrequent_if_exist&quot;`.<br><br>.. versionchanged:: 1.1<br>    `&#x27;infrequent_if_exist&#x27;` was added to automatically handle unknown<br>    categories and infrequent categories.<br><br>.. versionadded:: 1.6<br>   The option `&quot;warn&quot;` was added in 1.6.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;ignore&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy categories to clipboard\"\n",
       "                 onclick=\"copyToClipboard('categories',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-categories;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=categories,-%27auto%27%20or%20a%20list%20of%20array-like%2C%20default%3D%27auto%27\">\n",
       "            categories\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-categories;\">\n",
       "            categories: &#x27;auto&#x27; or a list of array-like, default=&#x27;auto&#x27;<br><br>Categories (unique values) per feature:<br><br>- &#x27;auto&#x27; : Determine categories automatically from the training data.<br>- list : ``categories[i]`` holds the categories expected in the ith<br>  column. The passed categories should not mix strings and numeric<br>  values within a single feature, and should be sorted in case of<br>  numeric values.<br><br>The used categories can be found in the ``categories_`` attribute.<br><br>.. versionadded:: 0.20</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;auto&#x27;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy drop to clipboard\"\n",
       "                 onclick=\"copyToClipboard('drop',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-drop;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=drop,-%7B%27first%27%2C%20%27if_binary%27%7D%20or%20an%20array-like%20of%20shape%20%28n_features%2C%29%2C%20%20%20%20%20%20%20%20%20%20%20%20%20default%3DNone\">\n",
       "            drop\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-drop;\">\n",
       "            drop: {&#x27;first&#x27;, &#x27;if_binary&#x27;} or an array-like of shape (n_features,),             default=None<br><br>Specifies a methodology to use to drop one of the categories per<br>feature. This is useful in situations where perfectly collinear<br>features cause problems, such as when feeding the resulting data<br>into an unregularized linear regression model.<br><br>However, dropping one category breaks the symmetry of the original<br>representation and can therefore induce a bias in downstream models,<br>for instance for penalized linear classification or regression models.<br><br>- None : retain all features (the default).<br>- &#x27;first&#x27; : drop the first category in each feature. If only one<br>  category is present, the feature will be dropped entirely.<br>- &#x27;if_binary&#x27; : drop the first category in each feature with two<br>  categories. Features with 1 or more than 2 categories are<br>  left intact.<br>- array : ``drop[i]`` is the category in feature ``X[:, i]`` that<br>  should be dropped.<br><br>When `max_categories` or `min_frequency` is configured to group<br>infrequent categories, the dropping behavior is handled after the<br>grouping.<br><br>.. versionadded:: 0.21<br>   The parameter `drop` was added in 0.21.<br><br>.. versionchanged:: 0.23<br>   The option `drop=&#x27;if_binary&#x27;` was added in 0.23.<br><br>.. versionchanged:: 1.1<br>    Support for dropping infrequent categories.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy dtype to clipboard\"\n",
       "                 onclick=\"copyToClipboard('dtype',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-dtype;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=dtype,-number%20type%2C%20default%3Dnp.float64\">\n",
       "            dtype\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-dtype;\">\n",
       "            dtype: number type, default=np.float64<br><br>Desired dtype of output.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&lt;class &#x27;numpy.float64&#x27;&gt;</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy min_frequency to clipboard\"\n",
       "                 onclick=\"copyToClipboard('min_frequency',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-min_frequency;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=min_frequency,-int%20or%20float%2C%20default%3DNone\">\n",
       "            min_frequency\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-min_frequency;\">\n",
       "            min_frequency: int or float, default=None<br><br>Specifies the minimum frequency below which a category will be<br>considered infrequent.<br><br>- If `int`, categories with a smaller cardinality will be considered<br>  infrequent.<br><br>- If `float`, categories with a smaller cardinality than<br>  `min_frequency * n_samples`  will be considered infrequent.<br><br>.. versionadded:: 1.1<br>    Read more in the :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy max_categories to clipboard\"\n",
       "                 onclick=\"copyToClipboard('max_categories',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-max_categories;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=max_categories,-int%2C%20default%3DNone\">\n",
       "            max_categories\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-max_categories;\">\n",
       "            max_categories: int, default=None<br><br>Specifies an upper limit to the number of output features for each input<br>feature when considering infrequent categories. If there are infrequent<br>categories, `max_categories` includes the category representing the<br>infrequent categories along with the frequent categories. If `None`,<br>there is no limit to the number of output features.<br><br>.. versionadded:: 1.1<br>    Read more in the :ref:`User Guide &lt;encoder_infrequent_categories&gt;`.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">None</td>\n",
       "        </tr>\n",
       "    \n",
       "\n",
       "        <tr class=\"default\">\n",
       "            <td><button type=\"button\" class=\"copy-paste-icon\"\n",
       "                 aria-label=\"Copy feature_name_combiner to clipboard\"\n",
       "                 onclick=\"copyToClipboard('feature_name_combiner',\n",
       "                          this.parentElement.nextElementSibling)\"\n",
       "            ></button></td>\n",
       "            <td class=\"param\">\n",
       "        <a class=\"param-doc-link\"\n",
       "            style=\"anchor-name: --doc-link-feature_name_combiner;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=feature_name_combiner,-%22concat%22%20or%20callable%2C%20default%3D%22concat%22\">\n",
       "            feature_name_combiner\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-feature_name_combiner;\">\n",
       "            feature_name_combiner: &quot;concat&quot; or callable, default=&quot;concat&quot;<br><br>Callable with signature `def callable(input_feature, category)` that returns a<br>string. This is used to create feature names to be returned by<br>:meth:`get_feature_names_out`.<br><br>`&quot;concat&quot;` concatenates encoded feature name and category with<br>`feature + &quot;_&quot; + str(category)`.E.g. feature X with values 1, 6, 7 create<br>feature names `X_1, X_6, X_7`.<br><br>.. versionadded:: 1.3</span>\n",
       "        </a>\n",
       "    </td>\n",
       "            <td class=\"value\">&#x27;concat&#x27;</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-categories_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=categories_,-list%20of%20arrays\">\n",
       "            categories_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-categories_;\">\n",
       "            categories_: list of arrays<br><br>The categories of each feature determined during fitting<br>(in order of the features in X and corresponding with the output<br>of ``transform``). This includes the category specified in ``drop``<br>(if any).</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">list</td>\n",
       "           <td>[array([&#x27;elect... dtype=object)]</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-drop_idx_;\"\n",
       "            rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.9/modules/generated/sklearn.preprocessing.OneHotEncoder.html#:~:text=drop_idx_,-array%20of%20shape%20%28n_features%2C%29\">\n",
       "            drop_idx_\n",
       "            <span class=\"param-doc-description\"\n",
       "            style=\"position-anchor: --doc-link-drop_idx_;\">\n",
       "            drop_idx_: array of shape (n_features,)<br><br>- ``drop_idx_[i]`` is the index in ``categories_[i]`` of the category<br>  to be dropped for each feature.<br>- ``drop_idx_[i] = None`` if no category is to be dropped from the<br>  feature with index ``i``, e.g. when `drop=&#x27;if_binary&#x27;` and the<br>  feature isn&#x27;t binary.<br>- ``drop_idx_ = None`` if all the transformed features will be<br>  retained.<br><br>If infrequent categories are enabled by setting `min_frequency` or<br>`max_categories` to a non-default value and `drop_idx[i]` corresponds<br>to an infrequent category, then the entire infrequent category is<br>dropped.<br><br>.. versionchanged:: 0.23<br>   Added the possibility to contain `None` values.</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">NoneType</td>\n",
       "           <td>None</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.preprocessing.OneHotEncoder.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:: 1.0</span>\n",
       "        </a>\n",
       "    </td>\n",
       "           <td class=\"fitted-att-type\">int</td>\n",
       "           <td>1</td>\n",
       "\n",
       "\n",
       "       </tr>\n",
       "    \n",
       "                    </tbody>\n",
       "                </table>\n",
       "            </details>\n",
       "        </div>\n",
       "    </div></div></div>\n",
       "        <div class=\"features fitted\">\n",
       "          <details>\n",
       "            <summary>\n",
       "              <div class=\"arrow\"></div>\n",
       "              <div>5 features</div>\n",
       "              <div class=\"image-container\">\n",
       "                <button type=\"button\" class=\"copy-paste-icon\"\n",
       "                  title=\"Copy output features (max 100)\"\n",
       "                  aria-label=\"Copy output features (max 100)\"\n",
       "                  onclick=\"\n",
       "                  event.stopPropagation();\n",
       "                  event.preventDefault();\n",
       "                  copyFeatureNamesToClipboard(this);\n",
       "                  \"\n",
       "                >\n",
       "                </button>\n",
       "              </div>\n",
       "            </summary>\n",
       "            <div class=\"features-container\">\n",
       "                <table class=\"features-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr>\n",
       "          <td>x0_electrónica</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x0_pop</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x0_regional</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x0_reguetón</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>x0_rock</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </div>\n",
       "          </details>\n",
       "        </div>\n",
       "    </div></div></div></div></div></div><div class='total_features'>\n",
       "        <div class=\"features fitted\">\n",
       "          <details>\n",
       "            <summary>\n",
       "              <div class=\"arrow\"></div>\n",
       "              <div>14 features</div>\n",
       "              <div class=\"image-container\">\n",
       "                <button type=\"button\" class=\"copy-paste-icon\"\n",
       "                  title=\"Copy output features (max 100)\"\n",
       "                  aria-label=\"Copy output features (max 100)\"\n",
       "                  onclick=\"\n",
       "                  event.stopPropagation();\n",
       "                  event.preventDefault();\n",
       "                  copyFeatureNamesToClipboard(this);\n",
       "                  \"\n",
       "                >\n",
       "                </button>\n",
       "              </div>\n",
       "            </summary>\n",
       "            <div class=\"features-container\">\n",
       "                <table class=\"features-table\">\n",
       "                  <tbody>\n",
       "                    \n",
       "        <tr>\n",
       "          <td>num__energia</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__bailabilidad</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__acustica</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__tempo_bpm</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__duracion_seg</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__seguidores_miles</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__colaboracion</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__explicita</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>num__en_playlist</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>cat__genero_electrónica</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>cat__genero_pop</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>cat__genero_regional</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>cat__genero_reguetón</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "        <tr>\n",
       "          <td>cat__genero_rock</td>\n",
       "        </tr>\n",
       "\n",
       "    \n",
       "                  </tbody>\n",
       "                </table>\n",
       "            </div>\n",
       "          </details>\n",
       "        </div>\n",
       "    </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-2');</script></body>"
      ],
      "text/plain": [
       "ColumnTransformer(transformers=[('num',\n",
       "                                 Pipeline(steps=[('imputar',\n",
       "                                                  SimpleImputer(strategy='median')),\n",
       "                                                 ('escalar',\n",
       "                                                  StandardScaler())]),\n",
       "                                 ['energia', 'bailabilidad', 'acustica',\n",
       "                                  'tempo_bpm', 'duracion_seg',\n",
       "                                  'seguidores_miles', 'colaboracion',\n",
       "                                  'explicita', 'en_playlist']),\n",
       "                                ('cat',\n",
       "                                 Pipeline(steps=[('imputar',\n",
       "                                                  SimpleImputer(strategy='most_frequent')),\n",
       "                                                 ('onehot',\n",
       "                                                  OneHotEncoder(handle_unknown='ignore',\n",
       "                                                                sparse_output=False))]),\n",
       "                                 ['genero'])])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pre_df = pipe.named_steps[\"pre\"].set_output(transform=\"pandas\")\n",
    "print(pre_df.transform(X_te.head(3)).round(2).T)\n",
    "pipe.named_steps[\"pre\"].set_output(transform=\"default\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "887bd1e5",
   "metadata": {},
   "source": [
    "Las numéricas quedan centradas en 0 y el género es una fila de ceros con un 1 en su columna. Este mismo `pre` se\n",
    "reutiliza en los notebooks siguientes del curso.\n",
    "\n",
    "## 9. Ejercicios\n",
    "\n",
    "Escribe cada función en la celda de abajo. Usa `X_tr`, `X_te`, `y_tr`, `y_te` y `crear_pre`.\n",
    "\n",
    "1. `con_seleccion(k)`: agrega `SelectKBest(f_classif, k=k)` entre `pre` y la logística, entrena y devuelve la\n",
    "   accuracy en test redondeada a 3 decimales. Esperado con `k=8`: `0.808`.\n",
    "2. `con_imputacion(estrategia)`: el mismo pipeline de la sección 6 pero con `crear_pre(estrategia)` para las\n",
    "   numéricas; devuelve la accuracy en test redondeada a 3 decimales. Esperado con `\"mean\"`: `0.811`.\n",
    "3. `genero_no_visto()`: toma la primera canción de `X_te`, cambia su género a `\"cumbia\"` y devuelve las 5 columnas de\n",
    "   género que produce `pre` para ella (una lista). Esperado: `[0.0, 0.0, 0.0, 0.0, 0.0]`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a05d3ee9",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:17.432961Z",
     "iopub.status.busy": "2026-10-18T17:51:17.432961Z",
     "iopub.status.idle": "2026-10-18T17:51:17.441988Z",
     "shell.execute_reply": "2026-10-18T17:51:17.440980Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ejercicio 1: pendiente (NotImplementedError)\n",
      "Ejercicio 2: pendiente (NotImplementedError)\n",
      "Ejercicio 3: pendiente (NotImplementedError)\n"
     ]
    }
   ],
   "source": [
    "def assert_eq(obtenido, esperado):\n",
    "    assert obtenido == esperado, f\"obtenido {obtenido}, esperado {esperado}\"\n",
    "\n",
    "\n",
    "def con_seleccion(k):\n",
    "    raise NotImplementedError  # escribe aquí tu solución\n",
    "\n",
    "\n",
    "def con_imputacion(estrategia):\n",
    "    raise NotImplementedError\n",
    "\n",
    "\n",
    "def genero_no_visto():\n",
    "    raise NotImplementedError\n",
    "\n",
    "\n",
    "probar(\"Ejercicio 1\", lambda: assert_eq(con_seleccion(8), 0.808))\n",
    "probar(\"Ejercicio 2\", lambda: assert_eq(con_imputacion(\"mean\"), 0.811))\n",
    "probar(\"Ejercicio 3\", lambda: assert_eq(genero_no_visto(), [0.0, 0.0, 0.0, 0.0, 0.0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "56a3faf7",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "### Soluciones"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "136d10a3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2026-10-18T17:51:17.447118Z",
     "iopub.status.busy": "2026-10-18T17:51:17.446111Z",
     "iopub.status.idle": "2026-10-18T17:51:17.720130Z",
     "shell.execute_reply": "2026-10-18T17:51:17.718117Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SelectKBest k=5:"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 0.803 | k=8: 0.808\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "imputación mean: 0.811 | most_frequent: 0.813\n",
      "género no visto -> columnas de género: [0.0, 0.0, 0.0, 0.0, 0.0] | probabilidad de Top 50: 0.016\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Solución 1: correcto\n",
      "Solución 2: correcto\n",
      "Solución 3: correcto\n"
     ]
    }
   ],
   "source": [
    "def sol_con_seleccion(k):\n",
    "    p = Pipeline([(\"pre\", crear_pre()), (\"sel\", SelectKBest(f_classif, k=k)),\n",
    "                  (\"modelo\", LogisticRegression(max_iter=2000))]).fit(X_tr, y_tr)\n",
    "    return round(p.score(X_te, y_te), 3)\n",
    "\n",
    "\n",
    "def sol_con_imputacion(estrategia):\n",
    "    p = Pipeline([(\"pre\", crear_pre(estrategia)), (\"modelo\", LogisticRegression(max_iter=2000))]).fit(X_tr, y_tr)\n",
    "    return round(p.score(X_te, y_te), 3)\n",
    "\n",
    "\n",
    "def sol_genero_no_visto():\n",
    "    cancion = X_te.head(1).copy()\n",
    "    cancion[\"genero\"] = \"cumbia\"\n",
    "    return [float(v) for v in pipe.named_steps[\"pre\"].transform(cancion)[0, -5:]]\n",
    "\n",
    "\n",
    "print(\"SelectKBest k=5:\", sol_con_seleccion(5), \"| k=8:\", sol_con_seleccion(8))\n",
    "print(\"imputación mean:\", sol_con_imputacion(\"mean\"), \"| most_frequent:\", sol_con_imputacion(\"most_frequent\"))\n",
    "cumbia = X_te.head(1).assign(genero=\"cumbia\")\n",
    "print(\"género no visto -> columnas de género:\", sol_genero_no_visto(),\n",
    "      \"| probabilidad de Top 50:\", pipe.predict_proba(cumbia)[0, 1].round(3))\n",
    "probar(\"Solución 1\", lambda: assert_eq(sol_con_seleccion(8), 0.808), estricto=True)\n",
    "probar(\"Solución 2\", lambda: assert_eq(sol_con_imputacion(\"mean\"), 0.811), estricto=True)\n",
    "probar(\"Solución 3\", lambda: assert_eq(sol_genero_no_visto(), [0.0, 0.0, 0.0, 0.0, 0.0]), estricto=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "71e6f525",
   "metadata": {},
   "source": [
    "- **Ejercicio 1:** con 8 de las 14 columnas la accuracy queda igual (0.808) y con 5 baja a 0.803. Como el selector\n",
    "  está dentro del pipeline, aprende qué columnas elegir solo con train.\n",
    "- **Ejercicio 2:** con la media se obtiene 0.811 y con la más frecuente 0.813: unas milésimas de diferencia, ruido en\n",
    "  375 canciones. La mediana sigue siendo la opción segura cuando hay atípicos, aunque aquí no cambie la cifra.\n",
    "- **Ejercicio 3:** el género `\"cumbia\"` no existía en train y queda como cinco ceros: el modelo trata la canción como\n",
    "  si no tuviera género conocido y no se rompe. Sin `handle_unknown=\"ignore\"`, `transform` lanzaría un error.\n",
    "\n",
    "## Resumen\n",
    "\n",
    "- Limpieza con reglas fijas antes de partir: 1525 → 1500 filas, 17 → 5 géneros, 19 duraciones corregidas.\n",
    "- Lo que aprende de los datos va dentro del pipeline: mediana (103 bpm, 88.2 mil seguidores), escalado y one-hot.\n",
    "- `pre`: 9 numéricas escaladas + 5 géneros = 14 columnas. Pipeline con logística: 0.808 de accuracy y 0.847 de AUC;\n",
    "  Dummy 0.725.\n",
    "- Preprocesar antes de partir infla poco en este caso (0.8476 contra 0.8474), pero seleccionar columnas con todo el\n",
    "  dataset hace que el ruido parezca señal (AUC 0.688 contra 0.54)."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
