Skip to content

Graphical tools for CLG

A CLG model

pyagrum.clg.notebook.exportCLG(clg, filename, , size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)

Section titled “pyagrum.clg.notebook.exportCLG(clg, filename, , size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)”

Export the clg as a picture.

  • Parameters:
    • clgdot (pydot.Dot) – pydot representation of the CLG.
    • filename (str) – The filename of the exported file.
    • 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.

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

Section titled “pyagrum.clg.notebook.getInference(clg, , evs=None, size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)”

return 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

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

Section titled “pyagrum.clg.notebook.showInference(clg, , evs=None, size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)”

display 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.

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

Section titled “pyagrum.clg.notebook.exportInference(clg, filename, , evs=None, size=None, nodeColor=None, arcWidth=None, arcColor=None, cmapNode=None, cmapArc=None, showMsg=None)”

export a representation of a CLG inference as a picture

  • Parameters:
    • clg (CLG) – Conditional Linear Gaussian.
    • filename (str) – The filename of the exported file.
    • 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

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

Section titled “pyagrum.clg.notebook.CLG2dot(clg, , 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.
    • 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

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

Section titled “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