support vector machine svm theoryvladimir vapnik and alexey chervonenkis (1960-1990)

27
SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Upload: espiridion-mezo

Post on 06-Feb-2015

18 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

SUPPORT VECTOR MACHINE SVM

TheoryVladimir Vapnik and Alexey Chervonenkis

(1960-1990)

Page 2: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

INTRODUCCION

• Técnica para clasificación y regresión

• Método de aprendizaje supervisado

• Usa un conjunto de ejemplos para entrenamiento.

• Solución “única”

• Robusto a ruido, multiples dimensiones y redundancia en las dimensiones

INTRODUCCIÓNIntroducción

ContenidoMarco teórico

No linealmente separablesConclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 3: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Posibles fronteras de decisión para datos linealmente separables

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 4: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Objetivo

• Dado un conjunto de ejemplos de entrenamiento• Construir un hiperplano “w” como superficie de

decisión.• De tal forma que la separación de las dos clases

sea máxima (principio de generalización)

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 5: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Margen de decisión

B1b11 b12

B2

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 6: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

CONTENIDO

• Marco teórico– Caso linealmente separable– Programación cuadrática– Condiciones Karush Kuhn-Tucker– El problema dual– Ejemplo básico

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 7: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

CONTENIDO

• Caso No-linealmente separable– Soft margin– Transformación de atributos– Funciones Kernel– Teorema de Mercer

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 8: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

CONTENIDO

• Fortalezas

• Debilidades

• Notas de clasificación

• Referencias

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 9: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Marco Teórico

• Métodos de aprendizaje estadístico.

• Redes de regularización, principio inductivo de penalización

• Implementación aproximada del método de minimización del riesgo estructural [1]

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 10: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

CASO: Linealmente separables

• Muestras de entrenamiento {(xi, yi)}Ni=1

• Dos clases yi = +1, yi = -1

• Función de decisión

wx + b = 0wxi + b >= 0 para yi = +1

wxi + b < 0 para yi = -1

El entrenamiento busca estimar los parámetros w, b

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 11: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Frontera de decisión y margen de SVM

d

x1 – x2

x1

w

wx + b = 0

wx + b = 1

wx + b = -1

x2

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 12: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

SVM Model• De la gráfica anterior tenemos:

w(x1-x2) = 2||w|| d = 2

d = 2 / ||w||Donde d es el margen de separación a maximizar

• Entonces la función de optimización es: f(w) = ||w||2 / 2

Esta optimización es un problema de programación cuadrática PQ (Bertsekas 1995)

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 13: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Problema de programación cuadrática PQ

• Usando el método de multiplicadores de Lagrange

J(w, b, α) = ½wTw – ΣNαi[yi(wxi + b)-1]

• Resolviendo tenemos que los parámetros óptimos son:

w0 = ΣNα0,i yi xi

b0 = 1- w0x(s) para d(s) = 1

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 14: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Condiciones de Karush Kuhn Tucker KKT

• Si los α >= 0 se permite usar KKT para manejar la restricción de desigualdad

yi(wxi + b) >= 1 • y convertirla en varias ecuaciones de

igualdad para cada ejemplo i:

αi[yi(wxi+b)-1] = 0• Todos los ejemplos donde los αi > 0 son los

vectores de soporte

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 15: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

El problema Dual

• Para resolver el problema “primario” de optimización en función de w, b y αi

• Se formula el problema dual, donde remplazamos la función de optimización por:

LD = ΣNαi – ½Σijαi αjyi yj xi xj

• La solución del problema dual es idéntica al primario y solo queda en función de αi y los ejemplos de entrenamiento

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 16: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Ejemplo• Usando PQ obtenemos αi para cada

ejemploX1 X2 Y αi

0.3858

0.4871

0.9218

0.7382

0.1763

0.4057

0.9355

0.2146

0.4687

0.611

0.4103

0.8936

0.0579

0.3529

0.8132

0.0099

1

-1

-1

-1

1

1

-1

1

65.526165.5261

000000

0 0.2 0.4 0.6 0.8 1

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0

Hallar los parámetros del hiperplano x1

x2

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 17: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Solución

w1 = Σαiyixi1 = 65.5621*1*0.3858 + 65.5621*-1*0.4871 = -6.64

w2 = Σαiyixi2 = 65.5621*1*0.4687 + 65.5621*-1*0.611 = -9.32

b1 = 1-wx1 = 1- (-6.64*0.3858) - (-9.32*0.4687) = 7.93

b2 = 1-wx2 = -1 – (-6.64*0.4871) - (-9.32*0.611) = 7.9289

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 18: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

CASO: No linealmente separables

Margen de decisión

B1b11 b12

B2

p

q

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 19: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

SOFT MARGIN

• Tolerancia al ruido• SVM debe considerar el equilibrio entre entre el ancho del

margen y errores tolerados en el entrenamiento• Replanteando las ecuaciones:

• wxi + b >= 1- ξi i = 1,2,...,N y ξi > 0

• Donde ξ provee una estimación del error del margen de separación• La optimización para el problema primario

Lp= ½wTw – CΣN ξi – ΣNαi[yi(wxi + b)-1+ ξi] – Σui

ξi

• El dual LD = ΣNαi – ½Σijαi αjyi yj xi xj Idéntica a la anterior

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 20: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Transformación de atributos

• Mapear los puntos de entrada a un espacio de características de orden mayor

0 0.2 0.4 0.6 0.8 1

1

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0

x1

-0.25 -0.20 -0.15 -0.10 -0.5

0

-0.3

-0.6

-0.9

-0.12

-0.15

-0.18

-0.21

-0.24

-0.27

-0.3

x1

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 21: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

FUNCION KERNEL

• Aplicamos la función de transformación

y(x) = ((x1-0.5)2 + (x2-0.5)2)1/2

φj(x) (x12, x2

2, (2x1)1/2, (2x2)1/2,1)

• Un multidimensional espacio puede ser transformado a un nuevo espacio de características donde los patrones tienen una mayor probabilidad de ser linealmente separables. Teorema de Cover

x {φj(x)} donde j = 1,2,...,m

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 22: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Teorema de Mercer• El principal requerimiento para una función

Kernel es que exista su correspondiente transformación tal que la función kernel calculada para un par de vectores es equivalente a su producto punto en el espacio transformado.

• Algunas funciones kernel para clasificación:K(x, y) = (x y + 1)p

K(x, y) = exp(-||x-y||2/(2s2))K(x, y) = tanh(kx y - d)

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 23: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)
Page 24: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Fortalezas• El entrenamiento es relativamente fácil.• No hay óptimo local, como en las redes neuronales.• Se escalan relativamente bien para datos en

espacios dimensionales altos.• El compromiso entre la complejidad del clasificador y

el error puede ser controlado explícitamente.• Datos no tradicionales como cadenas de caracteres

y árboles pueden ser usados como entrada a la SVM, en vez de vectores de características.

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 25: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Debilidades

• Se necesita una “buena” función kernel, es decir, se necesitan metodologías eficientes para sintonizar los parámetros de inicialización de la SVM.

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 26: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

Notas de clasificación• Las SVM son básicamente clasificadores para

2 clases.• Se puede cambiar la formulación del

algoritmo QP para permitir clasificación multiclase.

• Los datos son divididos “convenientemente” en dos partes de diferentes formas y una SVM es entrenada para cada forma de división.

• La clasificación multiclase es hecha combinando la salida de todos los clasificadores

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE

Page 27: SUPPORT VECTOR MACHINE SVM TheoryVladimir Vapnik and Alexey Chervonenkis (1960-1990)

REFERENCIAS1. Vapnik. The nature of statistical learning

theory. New York: Springer-Verlag, 1995.2. J. Mercer. Functions of positive and negative type and

their connection with the theory of integral equations. Philosophical Transactions of the Royal Society, London, A 209:415–446, 1909.

3. Vapnik. Statistical Learning Theory. Wiley, NY, 1998.4. Vapnik and O. Chapelle. Bounds on error expectation for

support vector machines. Neural Computation, 12(9):2013–2036, 2000.

5. Cortes and V. Vapnik. Support vector networks. Machine Learning, 20:273–297, 1995.

IntroducciónContenido

Marco teóricoNo linealmente separables

Conclusiones

MINERÍA DE DATOS | SUPPORT VECTOR MACHINE