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 modelevs (
dict[int | str,int | str | list[float]]) – the observationssize (
int | str) – size of the rendered graphcmap (
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