Jupyter notebook with Graphical Models

pyagrum.lib.notebook aims to facilitate the use of pyAgrum with jupyter notebook (or lab).

_images/pyAgrum_all.png

Visualization of graphical models

Important

For many graphical representations functions, the parameter size is directly transferred to graphviz. Hence, Its format is a string containing an int. However if size ends in an exclamation point “!” (such as size="4!"), then size is taken to be the desired minimum size. In this case, if both dimensions of the drawing are less than size, the drawing is scaled up uniformly until at least one dimension equals its dimension in size.

_images/effect_of_Graphviz_size.png

showBN()

show a Bayesian network

getBN()

get a HTML string for a Bayesian network

showInfluenceDiagram()

show an influence diagram as a graph

getInfluenceDiagram()

get a HTML string for an influence diagram as a graph

showMRF()

show a Markov random field

getMRF()

get an HTML string for a Markov random field

showCN()

show a credal network

getCN()

get a HTML string for a credal network

showInference()

show pydot graph for an inference in a notebook

getInference()

get a HTML string for an inference in a notebook

showJunctionTree()

Show a junction tree of a Bayesian network

getJunctionTree()

get a HTML string for a junction tree (more specifically a join tree)

Visualization of Tensors

showProba()

Show a mono-dim Tensor (a marginal)

getPosterior()

shortcut for getProba(pyagrum.getPosterior(bn,evs,target))

showPosterior()

shortcut for showProba(pyagrum.getPosterior(bn,evs,target))

getTensor()

return a HTML string of a pyagrum.Tensor as a HTML table.

showTensor()

show a pyagrum.Tensor as a HTML table.

Visualization of graphs

getDot()

get an HTML representation of a dot string

showDot()

show a dot string as a graph

getGraph()

get an HTML representation of a pydot graph

showGraph()

show a pydot graph in a notebook

Visualization of approximation algorithm

animApproximationScheme()

Show an animated version of an approximation algorithm.

Helpers

configuration()

Display the collection of dependance and versions

sideBySide()

display side by side args as HMTL fragment (using string, _repr_html_() or str())