clg.notebook.CLGInference2dot

pyagrum.clg.notebook.CLGInference2dot(clg, *, evs=None, size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)

create a pydot representation of the CLG

Parameters:
  • clg (CLG) – Conditional Linear Gaussian.

  • evs (dict[str,float]) – A dictionary of evidence.

  • size (str) – Size of the rendered graph.

  • nodeColor (dict[Tuple(int,int),float]) – A nodeMap of values to be shown as color nodes (with special color for 0 and 1).

  • arcWidth (dict[Tuple(int,int),float]) – An arcMap of values to be shown as bold arcs.

  • arcColor (dict[Tuple(int,int),float]) – An arcMap of values (between 0 and 1) to be shown as color of arcs.

  • cmapNode (ColorMap) – Color map to show the vals of Nodes.

  • cmapArc (ColorMap) – Color map to show the vals of Arcs.

  • showMsg (dict) – A nodeMap of values to be shown as tooltip.

Returns:

The desired representation of the Conditional Linear Gaussian.

Return type:

pydot.Dot

Example

import pyagrum.clg as gclg
import pyagrum.clg.notebook as gclgnb

clg = gclg.SEM.toclg("""
A = 2[1]
B = 1 + 0.5A[2]
C = 3 + B[1]
""")
g = gclgnb.CLGInference2dot(clg, evs={"C": 7.0})  # a pydot graph with the posteriors
g.to_string().startswith("digraph")
# True