Ir al contenido

Resumen 6 · Kernels

⬇ Descargar PDF · ir a la teoría completa · imprime con Ctrl + P

  • Una frontera curva es una frontera plana en un espacio de features ϕ\phi adecuado (anillos → x12+x22x_1^2+x_2^2).
  • Truco: el dual solo usa xi⊤xj\mathbf{x}_i^\top\mathbf{x}_j; cámbialo por K(xi,xj)=ϕ(xi)⊤ϕ(xj)K(\mathbf{x}_i,\mathbf{x}_j)=\phi(\mathbf{x}_i)^\top\phi(\mathbf{x}_j) sin construir ϕ\phi.
  • Kernel válido ⇔ simétrico y PSD (Mercer): Gram con autovalores ≥ 0. Cerrados bajo +, ×, escala positiva.
  • Lineal (global), polinómico (todos los monomios hasta grado dd, global), RBF (local, ϕ\phi de dimensión infinita).
  • γ del RBF: pequeño ⇒ casi lineal (underfit); grande ⇒ islas (overfit). C y γ juntos por CV; estandarizar.
  • Representante: f=∑iαiK(xi,⋅)f=\sum_i\alpha_iK(\mathbf{x}_i,\cdot). Kernel ridge en forma cerrada. Costo O(n2)O(n^2) memoria, O(n3)O(n^3) tiempo.
(x⊤z)2=ϕ(x)⊤ϕ(z),ϕ(x)=(x12, 2x1x2, x22)(\mathbf{x}^\top\mathbf{z})^2 = \phi(\mathbf{x})^\top\phi(\mathbf{z}),\quad \phi(\mathbf{x}) = (x_1^2,\ \sqrt2x_1x_2,\ x_2^2) Kpoly=(c+x⊤x′)d,KRBF=exp⁡(−γ∥x−x′∥2)K_\text{poly} = (c+\mathbf{x}^\top\mathbf{x}')^d,\qquad K_\text{RBF} = \exp(-\gamma\Vert\mathbf{x}-\mathbf{x}'\Vert^2) e2γx⊤x′=∑k=0∞(2γ)kk!(x⊤x′)k(todos los grados ⇒ ϕ infinita)e^{2\gamma\mathbf{x}^\top\mathbf{x}'} = \sum_{k=0}^\infty \frac{(2\gamma)^k}{k!}(\mathbf{x}^\top\mathbf{x}')^k\quad(\text{todos los grados ⇒ }\phi\text{ infinita}) α=(K+λI)−1y,f(x)=∑iαiK(xi,x)\boldsymbol\alpha = (\mathbf{K}+\lambda\mathbf{I})^{-1}\mathbf{y},\qquad f(\mathbf{x}) = \sum_i\alpha_iK(\mathbf{x}_i,\mathbf{x})
  • El truco no construye ϕ\phi.
  • El RBF tiene ϕ\phi infinita que nunca se calcula.
  • Restar kernels puede romper la PSD.
  • Nunca elegir γ por accuracy de entrenamiento.