FactorDict#

class pgmpy.factors.FactorDict[source]#

Bases: dict

dot(other)[source]#
classmethod from_dataframe(df, marginals)[source]#

Create a FactorDict from a given set of marginals.

Parameters:
df: pandas DataFrame object
marginals: List[Tuple[str]]

List of Tuples containing the names of the marginals.

Returns:
Factor dictionary: FactorDict
FactorDict with each marginal’s Factor representing the empirical

frequency of the marginal from the dataset.

get_factors()[source]#
product()[source]#