Este documento describe el aprendizaje de reglas para un sistema de recomendación contextual. Presenta la metodología utilizada, incluyendo la selección de atributos, la preparación de datos y el aprendizaje automático de reglas usando ILP. La evaluación muestra que el enfoque contextual obtiene el menor desempeño, posiblemente debido a reglas demasiado generales o con sobreajuste. Se necesitan reglas que capturen los datos sin estos problemas para mejorar las recomendaciones.
Manejo del Dengue, generalidades, actualización marzo 2024 minsa
Aprendizaje de Reglas para un SR contextual
1. Aprendizaje de Reglas para un
SR contextual
Blanca A. Vargas Govea
blanca.vargas@cenidet.edu.mx
Grupo de Sistemas de Recomendación
cenidet
Feb 16, 2012
2. Contenido
Surfeous
1 Antecedentes
Evaluación
2 Metodología para el aprendizaje de reglas
3 Selección de atributos
4 Preparación de datos
2
3. Surfeous: prototipo de SR
usuario enfoque contextual [1]
buscando restaurante
enfoque social
opiniones
3
ratings y tags
4. Surfeous: modelos de contexto
formalidad latitud dirección ciudad
transportación presupuesto
país fax alcohol
fumador alcohol cocina
cocina zona-fumar
ambiente interés ZIP
latitud
servicios
edad
usuario pago costo
item
hijos teléfono
estatura peso ambiente horas
longitud
estado
tipo-de-pago
personalidad estado-civil
religión días estacionamiento
accesibilidad
ocupación accesibilidad franquicia
color-favorito
formalidad
4
5. Evaluación: metodología
Básica
Popularidad ítem
Usuarios con más ratings
Por grupos
Usuarios con menos ratings
Distribución usuario-ítem
Selección de atributos
5
6. Evaluación: resultados
0.4
original
social
0.335
fusión
0.278
contexto
0.133
atributos-sel 0.335 0.327 0.133
0.35 La evaluación
0.3 más baja se
0.25 obtiene en el
social enfoque
0.2
fusión contextual
0.15
contexto
0.1
0.05
0
original atributos-sel 6
7. ¿Por qué es bajo? ¿Qué ocurre con las reglas?
¿Sobreajuste?
Si
es roja, redonda, de 5cm de
diámetro
y es jaspeada en el 20% de su
superficie
entonces
es una manzana
¿Demasiado generales?
Si
es roja
entonces
es una manzana
7
9. ¿Entonces?
Se necesita un conjunto de reglas que describa
los datos sin sobre-ajuste ni extrema
generalización
Aprendizaje de Reglas
9
10. Metodología
modelo del usuario
Selección de
modelo del ítem
atributos
con ambos modelos
Preparación de datos para el aprendizaje
Análisis del estado actual de las reglas
Aprendizaje automático usando ILP
Prueba de reglas aprendidas
10
12. ¿Para qué sirve?
[2]
Mejorar el desempeño
predictivo
Construir modelos más
Selección de eficientes
atributos
Mejorar el entendimiento
de los modelos
12
13. Selección de atributos: proceso
forward/backward
búsqueda: hill-climbing, best-first,...
Generación de
sub-conjuntos sub-conjunto chi-cuadrada, ganan-
cia de información,
Métrica clasificador, consisten-
Evaluación de
cia
sub-conjuntos filtro/wrapper
no
si
Criterio Validación de
de paro resultados
Umbral
No. de atributos seleccionados 13
Que no mejore la evaluación
14. Las Vegas Filter: criterio de inconsistencia
[3]
Conteo de inconsistencia
IC s ( A)=S ( A)−max S k ( A)
k
Valor de inconsistencia
∑ A∈S IC S ( A)
IR( S )=
∣S∣
14
15. Ejemplo
área costo franquicia fumar Rating A Rating B
1 i bajo n s 0 0
2 i bajo n s 1 0
3 i bajo n s 2 0
4 i bajo n s 1 1
5 i alto n n 0 1
6 i alto n n 1 1
7 i alto n n 2 1
8 e alto s n 1 1
9 e bajo n n 1 1
10 e bajo n s 2 2
15
16. Ejemplo
Sub-conjunto A Sub-conjunto B
Instancias iguales: 1,2,3,4 Instancias iguales: 1,2,3,4
n=4, clases=0,1,2,1 n=4, clases=0,0,0,1
clase frecuente=1 (2 instancias) clase frecuente=0 (3 instancias)
Conteo de inconsistencia (IC): 4-2=2 Conteo de inconsistencia (IC): 4-3=1
Instancias iguales: 5,6,7 Instancias iguales: 5,6,7
N=3, clases= 0,1,2 N=3, clases= 1,1,1
clase frecuente=1 (1 instancia) clase frecuente=1 (3 instancias)
Conteo de inconsistencia (IC): 3-1=2 Conteo de inconsistencia (IC): 3-3=0
Valor de Inconsistencia: Valor de Inconsistencia:
(2+2)/10 = 4/10 = 0.4 (1+0)/10 = 1/10 = 0.1
16
17. Descripción de los datos: Surfeous
1,160
130
ratings
restaurantes
138
usuarios
0,1,2
valores de
rating
8.41
115
ratings/usuario
restaurantes
con 1 rating
17
18. ¿Cómo se hizo?
Selección de atributos para: [4]
Modelo del usuario
Modelo del servicio
Modelo del usuario + Modelo del servicio
18
http://www.cs.waikato.ac.nz/ml/weka/
19. Preparación de datos
usercuisine userpayment
usuario
userprofile
Clase userattributes
19
20. Preparación de datos
Para el modelo de servicio se efectuó
un proceso similar.
Selección de
usuario
atributos
Selección de
ítem atributos
usuario Selección de
+ atributos
ítem
20
26. Preparación de datos para el aprendizaje
Objetivos
Obtener los elementos necesarios para el aprendizaje
automático: reglas prototipo, conocimiento del dominio e
instancias aterrizadas.
Preparar una plataforma de prueba de reglas.
26
27. Preparación de datos para el aprendizaje
<regla nombre="fumatrue1">
<antecedente>Restaurant(?r) ^
Reglas IDPlace(?r,?id)
^....</antecedente>
Formato RDF <consecuente>
sqwrl:selectDistinct(?id)</consecuente>
<tipo>2</tipo>
</regla>
usuariofuma(Restaurant,User):
Predicados atom_chars(Msg,"Regla1n"),
Prolog write(Msg),
permiteFumar(Restaurant,"section"),
esFumador(User,true).
permiteFumar(Item,Algo)
Extracción de tieneFormalidad(Item,Algo)
literales (condiciones) ofreceServicio(Item,Algo)
sirveAlimento(Item,Algo)
esFranquicia(Item,Algo)
Instanciar las esFumador("AAAM",false).
esFumador("aguilar",false).
condiciones con los esFumador("agusperez",false).
27
valores de atributos
28. Preparación de datos para el aprendizaje
Ya se tiene
Plataforma para prueba de reglas
Predicados correspondientes a atributos (condiciones)
En proceso
Análisis de las reglas originales
Reglas muy generales, producen varios resultados
por tipo de regla (fumador, estudiante, …)
28
29. Lo que sigue
modelo del usuario
Selección de
modelo del ítem
atributos
con ambos modelos
Preparación de datos para el aprendizaje
Análisis del estado actual de las reglas
Aprendizaje automático usando ILP
Prueba de reglas aprendidas
29
30. Referencias
[1] R. Ponce-Medellín, Búsquedas contextuales de servicios basados en
localización en un entorno de web social. 2010.
[2] I. Guyon and A. Elisseeff, “An introduction to variable and feature selection,”
Journal of Machine Learning Research, vol. 3, pp. 1157–1182, Mar. 2003.
[3] H. Liu and R. Setiono, “A probabilistic approach to feature selection - A
filter solution,” in 13th International Conference on Machine Learning, 1996,
pp. 319–327.
[4] M. Hall, E. Frank, G. Holmes, B. Pfahringer, P. Reutemann, and I. H. Witten,
“The WEKA data mining software: an update,” SIGKDD Explorations Newsletter,
vol. 11, no. 1, pp. 10–18, Nov. 2009.
30
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.
The algorithm considers that two instances are inconsistent if their attributes have the same values except for their class labels. For the matching in- stances, regardless of the class labels, the inconsistency count IC (Eq. 1 ) of an instance A 2 S is the number of instances in S equal to A minus the number of instances of the most frequent class ( k ) with the same attributes of S . The inconsistency rate IR of S (Eq. 2 ) is the sum of the in- consistency counts divided by the total number of instances.