explain.getInformation

pyagrum.explain.getInformation(bn, evs=None, size=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>)

get a HTML string for a bn annotated with results from inference : entropy and mutual information

Parameters:
  • bn (pyagrum.BayesNet) – the model

  • evs (dict[int | str, int | str | list[float]]) – the observations

  • size (int | str) – size of the rendered graph

  • cmap (matplotlib.colours.Colormap) – the cmap

Returns:

return the HTML string

Return type:

str

Example

import pyagrum as gum
import pyagrum.explain as expl

bn = gum.fastBN("A->B->Y;C->Y;Y->D")
html = expl.getInformation(bn, evs={"A": 1})
"<svg" in html
# True