WARMR algorithm in ALEPH (SWI-Prolog) -
i trying use warmr find frequent relational patterns in data; using aleph in swi-prolog. however, struggling figure out how , why previous attempts did not work.
i want make toy example work before move on full data. took toy "train" data aleph pack page: http://www.swi-prolog.org/pack/list?p=aleph
the aleph manual states ar
search:
ar
implements simplified form of type of association rule search conducted warmr system (see l. dehaspe, 1998, phd thesis, katholieke universitaet leuven). here, aleph finds rules cover @ least pre-specified fraction of positive examples. fraction specified parameter pos_fraction.
accordingly have inserted
:- set(search,ar). :- set(pos_fraction,0.01).
into background file (and deleted :- set(i,2).
)) , erased .n file of negative examples. have commented out determinations , modeh
declaration logic being searching frequent patterns, not rules (i.e. in supervised context head "output" variable , clauses in body -- "inputs" trying explain output), i.e. unsupervised task.
now, original trains
dataset trying construct rules "eastbound" trains. done having predicates car
, shape
, has_car(train, car)
etc. background knowledge relating these located in .b file , 5 positive examples (e.g eastbound(east1).
) in .f file (+ 5 negative examples, e.g. eastbound(west1).
, in .n file). leaving files unchanged (save changes described above) , running induce.
not produce sensible result (it return ground terms train(east1)
"rule", example). have tried moving of background knowledge .f file did not produce sensible either.
how go constructing .f , .b files? should positive examples file if not looking explain positive examples (which surely constitute supervised problem) instead find frequent patterns in data (unsupervised problem)? missing something?
any appreciated.
first of if can use original warmr think better. think need academic free use. can try asking license. https://dtai.cs.kuleuven.be/ace/
to association rules, put examples want in f file. n file can have examples in or think empty.
the thing change put :
:- set(search,ar). :- set(pos_fraction,0.01).
in .b file. keep determinations , mode declarations.
the set(i,2)
limits length of query having 2 additional literals (i think) might want larger.
?-read_all(train).
induce.
you out of 'good clauses' think frequent queries.
[good clauses] eastbound(a). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), long(b). [pos cover = 2 neg cover = 0] [pos-neg] [2] eastbound(a) :- has_car(a,b), open_car(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), shape(b,rectangle). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), wheels(b,2). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), load(b,rectangle,3). [pos cover = 1 neg cover = 0] [pos-neg] [1] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), short(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), closed(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), shape(b,rectangle). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), wheels(b,2). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), load(b,triangle,1). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), long(b). [pos cover = 2 neg cover = 0] [pos-neg] [2] eastbound(a) :- has_car(a,b), open_car(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), shape(b,rectangle). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), wheels(b,3). [pos cover = 3 neg cover = 0] [pos-neg] [3] eastbound(a) :- has_car(a,b), load(b,hexagon,1). [pos cover = 1 neg cover = 0] [pos-neg] [1] eastbound(a) :- has_car(a,b), has_car(a,c). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), short(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), open_car(b). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), shape(b,rectangle). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), wheels(b,2). [pos cover = 5 neg cover = 0] [pos-neg] [5] eastbound(a) :- has_car(a,b), load(b,circle,1). [pos cover = 3 neg cover = 0] [pos-neg] [3] eastbound(a) :- has_car(a,b), open_car(b), shape(b,rectangle). [pos cover = 4 neg cover = 0] [pos-neg] [4]
etc etc
the rules of form eastbound(a):-blah blah. counting eastbound examples. think of example_covered(a):-blah blah
Comments
Post a Comment