Export and visualize Graphical models and Tensors (png, pdf)
pyagrum.lib.image aims to graphically export models and inference using pydot (and then graphviz).
1import pyagrum as gum
2from pyagrum.lib.image as gumimage
3
4bn = gum.fastBN("a->b->d;a->c->d[3]->e;f->b")
5gumimage.export(bn,"out/test_export.png",
6 nodeColor={'a': 1,
7 'b': 0.3,
8 'c': 0.4,
9 'd': 0.1,
10 'e': 0.2,
11 'f': 0.5},
12 arcColor={(0, 1): 0.2,
13 (1, 2): 0.5},
14 arcWidth={(0, 3): 0.4,
15 (3, 2): 0.5,
16 (2,4) :0.6})
Visualization of models and inference
export a graphical model or an inference or an obj with _repr_html as an image |
|
the graphical representation of an inference in a notebook |