lib.notebook.getTensor
- pyagrum.lib.notebook.getTensor(pot, digits=None, withColors=None, varnames=None)
return a HTML string of a
pyagrum.Tensoras a HTML table. The first dimension is special (horizontal) due to the representation of conditional probability table- Parameters:
pot (
pyagrum.Tensor) – the tensor to showdigits (
int) – number of digits to showwithColors (
bool) – background for proba cells or notvarnames (
list[str]) – the aliases for variables name in the table
- Returns:
the html representation of the Tensor (as a string)
- Return type:
str
Example
import pyagrum as gum
import pyagrum.lib.notebook as gnb
bn = gum.fastBN("A->B->C")
html = gnb.getTensor(bn.cpt("B"), digits=2)
html.startswith("<table")
# True