Professional Documents
Culture Documents
CP ML/DM
2
CONSTRAINT PROGRAMMING & MACHINE LEARNING/DATA MINING
Boosting DM/ML via CP
CP ML/DM
CP ML/DM
Constraint Network
CP
Solver
Solution
6
CONSTRAINT ACQUISITION - MOTIVATION
Constraint Network
CP
Solver
Solution
Question: How does the user write down the constraints of a problem?
Limitations:
• Modelling constraint networks require a fair expertise [Freuder99, Frisch et al.05, Smith06]
• Conceptual and technological gap
• Error-prone
• Hard to take advantage of raw data
Need: Simple way to build constraint network è Modeller-assistant
7
CONSTRAINT ACQUISITION - MOTIVATION
Learning process Constraint
solution
non-solution Acquisition
Constraint
Problem
Network
CP
Solver
Solution
Question: How does the user write down the constraints of a problem?
Limitations:
• Modelling constraint networks require a fair expertise [Freuder99, Frisch et al.05, Smith06]
• Conceptual and technological gap
• Error-prone
• Hard to take advantage of raw data
Need: Simple way to build constraint network è Modeller-assistant
8
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
9
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
10
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
11
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
12
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
DX H
E+
Positives
Concept learning
E-
Negatives
Training Set
13
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
DX H
E+
Positives
Concept learning
E-
Negatives
Training Set f ≡ P1 ∧ P2 ∧ P3
Version space
14
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
DX H
E+
Positives
Concept learning
E-
Negatives
Training Set f ≡ P1 ∧ P2 ∧ P3
Version space
Constraint Programming:
DX E+
Positives
E-
Negatives
15
VERSION SPACE LEARNING (OVERVIEW) [MITCHELL82]
DX H
E+
Positives
Concept learning
E-
Negatives
Training Set f ≡ P1 ∧ P2 ∧ P3
Version space
Constraint Programming:
DX B
E+
Positives
Constraint Acquisition
E-
Negatives
L ≡ C1 ∧ C2 ∧ C3
Constraint Network
16
CONSTRAINT ACQUISITION PROBLEM
E- ;
• Inputs:
• (X,D): Vocabulary
• Γ: Constraint language T
• B: Basis (constraints/hypothesis)
• T: Target Network (concept to learn) L
17
EXAMPLE
• INPUT:
• X = {x1, x2, x3}
• D(xi) = {1,2,3}
• Γ = { < , = }
• B = {xi < xj, xi = xj, ∀i, j}
• T ≡ {(1,2,1), (2,3,2)}
18
EXAMPLE
• INPUT: • OUTPUT:
• X = {x1, x2, x3}
• D(xi) = {1,2,3} • L1 = {x1 = x3, x1 < x2}
• Γ = { < , = } OR
• B = {xi < xj, xi = xj, ∀i, j} • L2 = {x1 = x3, x3 < x2}
• T ≡ {(1,2,1), (2,3,2)}
X2
Equivalence class X2
< <
X1 = X3 X1 = X3
L1 L2
19
CONSTRAINT ACQUISITION PROBLEM
E- ;
Convergence Problem:
• L agrees with E
• For any other network C′ ⊆ B
agreeing with E, we have: T
L
sol(C′) = sol(L)
E+ B
20
CONSTRAINT ACQUISITION PROBLEM
E- ;
Convergence Problem:
• L agrees with E
• For any other network C′ ⊆ B
agreeing with E, we have: T
L
sol(C′) = sol(L)
E+ B
21
CONSTRAINT ACQUISITION PROBLEM
E- ;
T T
L
E+ B
22
CONSTRAINT ACQUISITION PROBLEM
E- ;
T
L
T
B
Collapse! E+ B
23
CONACQ
ACQUISITION USING MEMBERSHIP QUERIES
CONACQ [COCONUT These 2006; Bessiere, Koriche, Lazaar, O’Sullivan, AIJ17]
• SAT-Based constraint acquisition E- ;
• Bidirectional inference using Membership queries
• Conacq1.0 (passive learning)
• Conacq2.0 (active learning)
• Connexion between literals li and constraints Ci T
• li = 1 ⇒ Ci ∈ L L
E+ B
25
ACQUISITION USING MEMBERSHIP QUERIES
CONACQ [COCONUT These 2006; Bessiere, Koriche, Lazaar, O’Sullivan, AIJ17]
• SAT-Based constraint acquisition E- ;
• Bidirectional inference using Membership queries
• Conacq1.0 (passive learning)
• Conacq2.0 (active learning)
• Connexion between literals li and constraints Ci T
• li = 1 ⇒ Ci ∈ L L
⋀
Ω = ( ¬x2 ∧ ¬x4 ∧ ¬x7) (x1 ∨ x3 ∨ x5 ∨ x8) . . .
Positive example
Bottom-up inference
E+ B
26
ACQUISITION USING MEMBERSHIP QUERIES
CONACQ [COCONUT These 2006; Bessiere, Koriche, Lazaar, O’Sullivan, AIJ17]
• SAT-Based constraint acquisition E- ;
• Bidirectional inference using Membership queries
• Conacq1.0 (passive learning)
• Conacq2.0 (active learning)
• Connexion between literals li and constraints Ci T
• li = 1 ⇒ Ci ∈ L L
⋀
Ω = ( ¬x2 ∧ ¬x4 ∧ ¬x7) (x1 ∨ x3 ∨ x5 ∨ x8) . . .
Positive example Negative example
Bottom-up inference Top-down inference
E+ B
27
ACQUISITION USING MEMBERSHIP QUERIES
CONACQ [COCONUT These 2006; Bessiere, Koriche, Lazaar, O’Sullivan, AIJ17]
• SAT-Based constraint acquisition E- ;
• Bidirectional inference using Membership queries
• Conacq1.0 (passive learning)
• Conacq2.0 (active learning)
• Connexion between literals li and constraints Ci T
• li = 1 ⇒ Ci ∈ L L
⋀
Ω = ( ¬x2 ∧ ¬x4 ∧ ¬x7) (x1 ∨ x3 ∨ x5 ∨ x8) . . .
Positive example Negative example
Bottom-up inference Top-down inference
E+ B
28
CONACQ.1 (PASSIVE LEARNING)
If e is negative
Top-down-inference()
Else
Bottom-up—inference()
29
CONACQ.1 (PASSIVE LEARNING)
30
CONACQ.1 (PASSIVE LEARNING)
Top-down inference
31
CONACQ.1 (PASSIVE LEARNING)
Top-down inference
Bottom-up inference
32
CONACQ.2 (ACTIVE LEARNING)
If query is negative
Top-down-inference()
Else
Bottom-up—inference()
33
CONACQ.2 (ACTIVE LEARNING)
34
More Complexe
Systems
ACQUISITION USING COMPLEX QUERIES
E- ;
• Matchmaker agents [Freuder and Wallace wAAAI97]
T
• Argument-Based CONACQ [Friedrich et al. ICDM’09]
L
36
STRUCTURED PROBLEM ACQUISITION
;
•ModelSeeker [Beldiceanu and Simonis, CP’11’12]
• A passive learning
• Based on global constraint catalogue (≈1000)
• BuEom-up inference T
• ModelSeeker learns constraints underlying the L
scheduling of the Bundesliga (the German
Football Liga) from just one example.
E+ B
37
STRUCTURED PROBLEM ACQUISITION
;
•ModelSeeker [Beldiceanu and Simonis, CP’11’12]
• A passive learning
• Based on global constraint catalogue (≈1000)
• BuEom-up inference T
• ModelSeeker learns constraints underlying the L
scheduling of the Bundesliga (the German
Football Liga) from just one example.
E+ B
38
QUACQ
QUACQ: QUICK ACQUISITION
E- ;
40
MEMBERSHIP QUERIES
ask(2, 8, 4, 2, 6, 5, 1, 6)
41
MEMBERSHIP QUERIES
ask(2, 8, 4, 2, 6, 5, 1, 6) = No
42
PARTIAL QUERIES
ask(2, 8, 4, 2, -, -, -, -) = No
43
PARTIAL QUERIES
ask(2, 8, -, -, -, -, -, -) = Yes
44
QUACQ: QUICK ACQUISITION
QUACQ
yes
reduce(B)
ask(MQ)
Gen-query =x
INPUT
QUACQ
yes
reduce(B)
ask(MQ)
Gen-query =x
INPUT
No
FindScope
ask(PQ)
QUACQ
yes
reduce(B)
ask(MQ)
Gen-query =x
INPUT
Update(L)
C
No
FindScope FindC
scope
ask(PQ)
QUACQ
yes
reduce(B)
ask(MQ)
Gen-query B=x L
INPUT
Update(L)
C
No
FindScope FindC
scope
ask(PQ)
49
QUACQ: QUICK ACQUISITION
50
findScope
QUACQ: FINDSCOPE (SKETCH)
ask(2, 8, 4, 2, 6, 5, 1, 6) = No
52
QUACQ: FINDSCOPE (SKETCH)
findScope(e,Y,R):
if Y singleton return Y
split(Y)
return S1 union S2
53
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
nb_queries=00
54
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
nb_queries=01
55
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 1, 2345)= ∅
nb_queries=02
56
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 1, 2345)= ∅
findScope(e, 2, 345)= 2
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
nb_queries=02
58
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
nb_queries=03
59
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
findScope(e, 3, 452)= ∅
nb_queries=04
60
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
findScope(e, 3, 452)= ∅
findScope(e, 45, 2)= 5
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
findScope(e, 3, 452)= ∅
findScope(e, 45, 2)= 5
findScope(e, 4, 25)= ∅
nb_queries=05
62
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
findScope(e, 3, 452)= ∅
findScope(e, 45, 2)= 5
findScope(e, 4, 25)= ∅
//already asked query
findScope(e, 5, 2)= 5
nb_queries=05
63
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 34
findScope(e, 3, 452)= ∅
findScope(e, 45, 2)= 5
nb_queries=05
64
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅)
findScope(e, 12, 345)= 2
findScope(e, 345, 2)= 54
nb_queries=05
65
QUACQ: FINDSCOPE (EXAMPLE)
Negative example e on 12345 variables findScope(e,Y,R):
Expected scopes ={25, 234} if ask(R)=No return emptyset
if Y singleton return Y
split(Y)
return S1 union S2
trace:
findScope(e, 12345, ∅) = 25
nb_queries=05
66
findC
QUACQ: FINDC
findC(Y):
while true
if ask(e)= Yes
Remove from Delta all constraints rejecting e
else
Keep in Delta only constraints rejecting e
68
QUACQ: FINDC (EXAMPLE)
69
COMPLEXITY OF QUACQ
O( | T | . (log | X | + | Γ | )
O( | B | )
E+
70
Discussion
QUACQ LIMITATIONS
72
QUACQ LIMITATIONS
• Solutions to (1):
• Complexe queries (generalisation [Bessiere et al., ECAI’14, ICTAI’15],
recommandation [Daoudi et al., IJCAI’16], …)
• More elicitation (MultiAcq [Arcangioli et al., IJCAI’16], MQuacq [Tsouros, CP’18],…)
73
QUACQ LIMITATIONS
• Solutions to (2):
• Adaptive and time-bounded query generator (T-QUACQ [Ait Addi,
CPAIOR’18])
74
QUACQ LIMITATIONS
• Solutions to (1)&(2):
• Parallel Constraint Acquisition (future work)
• Deep Constraint Acquisition (future work)
75
QUACQ LIMITATIONS
76
CONSTRAINT ACQUISITION TOOLBOX
Building
Complexity
S1
S2 #queries
to converge
Answering
Complexity
77
SOME THOUGHTS
78
Exercises
EXO1: CONACQ
80
EXO2: QUACQ
81
EXO3: FINDSCOPE
•Given X= [1,2,3,4,5,6,7,8,9]
•Given a negative example e violating constraints on: [2,9], [3,4,8], [2,5,7]
1. Do a shuffle on X
2. Use FindScope function to return a violated constraint scope
3. How many queries are asked to return a scope?
findScope(e,Y,R):
if Y singleton return Y
split(Y)
return S1 union S2
82
EXO4: FINDC
• Γ= {=, ≠, <, >, ≤,≥}
• Scope: (x3,x5)
• Target: x3 ≠ x5
1. Use FindC to learn the target constraint
findC(Y):
while true
if ask(e)= Yes
Remove from Delta all constraints rejecting e
else
Keep in Delta only constraints rejecting e
83
Demo
http://info-demo.lirmm.fr:8080/web-acq/
https://gite.lirmm.fr/constraint-acquisition-team/quacq