jmschrei / pomegranate

Fast, flexible and easy to use probabilistic modelling in Python.
http://pomegranate.readthedocs.org/en/latest/
MIT License
3.35k stars 589 forks source link

[BUG] The comment of class BayesianNetwork(Distribution) in the source code seems to be incorrect. #1042

Closed ljw20180420 closed 2 months ago

ljw20180420 commented 1 year ago

The current comment says that:

Parameters

distributions: tuple or list or None
A set of distribution objects. These do not need to be initialized,
i.e. can be "Categorical()". Currently, they must be either Categorical
or JointCategorical distributions. If provided, they must be consistent
with the provided edges in that every conditional distribution must
have at least one parent in the provided structure. Default is None.

However, this conflicts the following lines in the add_distribution method:

if not isinstance(distribution, (Categorical, ConditionalCategorical)): raise ValueError("Must be Categorical or ConditionalCategorical")

jmschrei commented 2 months ago

Oops, typo. Fixed.