lib.notebook.showTensor

pyagrum.lib.notebook.showTensor(pot, digits=None, withColors=None, varnames=None)

show a pyagrum.Tensor as a HTML table. The first dimension is special (horizontal) due to the representation of conditional probability table

Parameters:
  • pot (pyagrum.Tensor) – the tensor to show

  • digits (int) – number of digits to show

  • withColors (bool) – background color for proba cells or not

  • varnames (list[str]) – the aliases for variables name in the table

Return type:

None

Example

import pyagrum as gum
import pyagrum.lib.notebook as gnb

bn = gum.fastBN("A->B->C")
gnb.showTensor(bn.cpt("B"), digits=2)