FactorDict#
- class pgmpy.factors.FactorDict[source]#
Bases:
dict- 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.