Hi Fabrizio,
today I watched your video
and I think I begin to make a little bit progress in understanding how it works. But maybe it is just hard to create example code for this topic which is minimal and in the same time has a huge expressiveness. I tend do search for such examples for learning.
The best example for beginners which I found is in my opinion the shop example :
cplint/shop.pl at b4497e8fb1bd1c03805b87db5f75682464e7de8c Β· friguzzi/cplint Β· GitHub .
But as I understood it only allows the emblem calculation (induce_par) and not the slipcover calculation (induce).
For slipcover I need then also additionally input_cw, modeh, modep and determination and optionally lookahead. But i can spare out the βinβ section.
You said my example is missing a negative example. How do I express this? Do I use β\+β in predicates or do I use βnegβ in models?
I have an example which seems to work but has no explicit negation in it:
:- use_module( library( slipcover)).
:- sc.
:- set_sc(verbosity,3).
% :- set_sc(depth_bound,false).
% :- set_sc(neg_ex,given).
bg([]).
fold(train,[1,2,3,4]).
output( p/0).
output( q/0).
modeh(*,p).
modeh(*,q).
:- begin_in.
p: 0.4 ; q : 0.6.
:- end_in.
begin(model(1)).
p.
end(model(1)).
begin(model(2)).
q.
end(model(2)).
begin(model(3)).
q.
end(model(3)).
begin(model(4)).
p.
end(model(4)).
/*
(ins)?- induce_par([train],P),test(P,[train],LL,AUCROC,ROC,AUCPR,PR).
Initial theory
p:0.4 ; q:0.6.
Initial score -5.708465
Restart number 1
Random_restart: Score -5.545177
/* EMBLEM Final score -5.545177
Wall time 0.000000 */
p:0.5 ; q:0.5.
Testing
P = [(p:0.5;q:0.5:-true)],
LL = -5.545177444479562,
AUCROC = AUCPR, AUCPR = 0.5,
ROC = c3{axis:_{x:_{max:1.0, min:0.0, padding:0.0, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}, y:_{max:1.0, min:0.0, padding:_{bottom:0.0, top:0.0}, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}}, data:_{rows:[x-'ROC', 0-0, 1.0-1.0], x:x}},
PR = c3{axis:_{x:_{max:1.0, min:0.0, padding:0.0, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}, y:_{max:1.0, min:0.0, padding:_{bottom:0.0, top:0.0}, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}}, data:_{rows:[x-'PR', 0.0-0.5, 0.25-0.5, 0.5-0.5, 0.75-0.5, 1-0.5], x:x}}.
(ins)?- in(P),test(P,[train],LL,AUCROC,ROC,AUCPR,PR).
Testing
P = [(p:0.4;q:0.6)],
LL = -5.708465422560582,
AUCROC = AUCPR, AUCPR = 0.5,
ROC = c3{axis:_{x:_{max:1.0, min:0.0, padding:0.0, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}, y:_{max:1.0, min:0.0, padding:_{bottom:0.0, top:0.0}, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}}, data:_{rows:[x-'ROC', 0-0, 0.5-0.5, 1.0-1.0], x:x}},
PR = c3{axis:_{x:_{max:1.0, min:0.0, padding:0.0, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}, y:_{max:1.0, min:0.0, padding:_{bottom:0.0, top:0.0}, tick:_{values:[0.0, 0.1, 0.2, 0.3, 0.4|...]}}}, data:_{rows:[x-'PR', 0.0-0.5, 0.25-0.5, 0.5-0.5, 0.75-0.5, 1.0-0.5], x:x}}.
*/
Do I make an indirect negation anywhere?
Thanks in advance,
Frank.