Tony-sama / pylfit

Python implementation of the main algorithms of the Learning From Interpretation Transitions (LFIT) framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get the rules in addition to the predictions when using DMVLP !

o-ikne opened this issue · comments

  • Is there a way to have in addition to the predicted states all the rules that allow us to have these predictions when using DMVLP ? like having a dictionary in which for each predicted state we have all the rules that are associated with it. For example :
predictions = {state1 : [rules for state1], state2 : [rules for state2], ...}

Added a parameter 'explanation=Bool' to DMVLP.predict to obtain requested behavior, example is given in 'tests/examples/api_gula_and_pride_example.py':
model.predict(["1","0","1"], semantics="synchronous", default=None, explanation=True)
output
{('0', '1', '0'): [0=0 :- 1=0., 1=1 :- 0=1, 2=1., 2=0 :- 0=1.]}

A dictionary where each key is a requested feature state (as a tuple of string), values are list of object of type pylfit.objects.Rule.

Default behavior of DMVLP.predict now output the rules that can be used to produce each target state.