Cannot use VariableElimination in showInference
Trying to pass different engines into gum.showInference.
When I use gum.VariableElimination
, I get a TypeError
. I am using pyAgrum 1.7.1
import pyAgrum as gum
import pyAgrum.lib.notebook as gnb
bn1=gum.fastBN("a->b;a->c;b->c;c->d",3)
gnb.showInference(bn1,engine=gum.VariableElimination, evs={})
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[18], line 2
1 bn1=gum.fastBN("a->b;a->c;b->c;c->d",3)
----> 2 gnb.showInference(bn1,engine=gum.VariableElimination, evs={})
File ~/anaconda3/envs/trueskill_gum/lib/python3.10/site-packages/pyAgrum/lib/notebook.py:1008, in showInference(model, **kwargs)
1005 else:
1006 size = gum.config["notebook", "default_graph_inference_size"]
-> 1008 showGraph(prepareShowInference(model, **kwargs), size)
File ~/anaconda3/envs/trueskill_gum/lib/python3.10/site-packages/pyAgrum/lib/image.py:159, in prepareShowInference(model, engine, evs, targets, size, nodeColor, factorColor, arcWidth, arcColor, cmap, cmapArc, graph, view)
157 if engine is None:
158 engine = gum.LazyPropagation(model)
--> 159 return BNinference2dot(model, size=size, engine=engine, evs=evs, targets=targets, nodeColor=nodeColor,
160 arcWidth=arcWidth,
161 arcColor=arcColor,
162 cmapNode=cmap, cmapArc=cmapArc
163 )
164 if isinstance(model, gum.MarkovRandomField):
165 if view is None:
File ~/anaconda3/envs/trueskill_gum/lib/python3.10/site-packages/pyAgrum/lib/bn2graph.py:200, in BNinference2dot(bn, size, engine, evs, targets, nodeColor, arcWidth, arcColor, cmapNode, cmapArc, dag)
198 else:
199 ie = engine
--> 200 ie.setEvidence(evs)
201 ie.makeInference()
202 stopTime = time.time()
TypeError: VariableElimination.setEvidence() missing 1 required positional argument: 'evidces'
The same TypeError
happens when you pass evs=None