

def __init__(self, variables, cardinality, values):
    "\n        Initialize a Joint Probability Distribution class.\n\n        Defined above, we have the following mapping from variable\n        assignments to the index of the row vector in the value field:\n\n        +-----+-----+-----+-------------------------+\n        |  x1 |  x2 |  x3 |    P(x1, x2, x2)        |\n        +-----+-----+-----+-------------------------+\n        | x1_0| x2_0| x3_0|    P(x1_0, x2_0, x3_0)  |\n        +-----+-----+-----+-------------------------+\n        | x1_1| x2_0| x3_0|    P(x1_1, x2_0, x3_0)  |\n        +-----+-----+-----+-------------------------+\n        | x1_0| x2_1| x3_0|    P(x1_0, x2_1, x3_0)  |\n        +-----+-----+-----+-------------------------+\n        | x1_1| x2_1| x3_0|    P(x1_1, x2_1, x3_0)  |\n        +-----+-----+-----+-------------------------+\n        | x1_0| x2_0| x3_1|    P(x1_0, x2_0, x3_1)  |\n        +-----+-----+-----+-------------------------+\n        | x1_1| x2_0| x3_1|    P(x1_1, x2_0, x3_1)  |\n        +-----+-----+-----+-------------------------+\n        | x1_0| x2_1| x3_1|    P(x1_0, x2_1, x3_1)  |\n        +-----+-----+-----+-------------------------+\n        | x1_1| x2_1| x3_1|    P(x1_1, x2_1, x3_1)  |\n        +-----+-----+-----+-------------------------+\n\n        Parameters\n        ----------\n        variables: list\n            List of scope of Joint Probability Distribution.\n        cardinality: list, array_like\n            List of cardinality of each variable\n        value: list, array_like\n            List or array of values of factor.\n            A Joint Probability Distribution's values are stored in a row\n            vector in the value using an ordering such that the left-most\n            variables as defined in the variable field cycle through their\n            values the fastest.\n\n        Examples\n        --------\n        >>> import numpy as np\n        >>> from pgmpy.factors import JointProbabilityDistribution\n        >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 2, 2], np.ones(8)/8)\n        >>> print(prob)\n        x1    x2    x3      P(x1,x2,x3)\n        ----  ----  ----  -------------\n        x1_0  x2_0  x3_0         0.1250\n        x1_0  x2_0  x3_1         0.1250\n        x1_0  x2_1  x3_0         0.1250\n        x1_0  x2_1  x3_1         0.1250\n        x1_1  x2_0  x3_0         0.1250\n        x1_1  x2_0  x3_1         0.1250\n        x1_1  x2_1  x3_0         0.1250\n        x1_1  x2_1  x3_1         0.1250\n       "
    if np.isclose(np.sum(values), 1):
        super(JointProbabilityDistribution, self).__init__(variables, variables, values)
    else:
        raise ValueError("The probability values doesn't sum to 1.")

dataset/ETHPy150Open pgmpy/pgmpy/pgmpy/factors/JointProbabilityDistribution.py JointProbabilityDistribution.__init__/VarMisuse@46/1078 `cardinality`->`variables`