def __init__(self, *factors_list):
        """
        Initialize the factor set class.

        Parameters
        ----------
        factors_list: Factor1, Factor2, ....
            All the factors whose product is represented by the factor set

        Examples
        --------
        >>> from pgmpy.factors import FactorSet
        >>> from pgmpy.factors.discrete import DiscreteFactor
        >>> phi1 = DiscreteFactor(['x1', 'x2', 'x3'], [2, 3, 2], range(12))
        >>> phi2 = DiscreteFactor(['x3', 'x4', 'x1'], [2, 2, 2], range(8))
        >>> factor_set = FactorSet(phi1, phi2)
        >>> factor_set
        <pgmpy.factors.FactorSet.FactorSet at 0x7f8e32af6d50>
        >>> print(factor_set)
        set([<DiscreteFactor representing phi(x1:2, x2:3, x3:2) at 0x7f8e32b4c2d0>,
             <DiscreteFactor representing phi(x3:2, x4:2, x1:2) at 0x7f8e32b4c710>])
        """
        if not all(isinstance(phi, BaseFactor) for phi in factors_list):
            raise TypeError("Input parameters must be child classes of BaseFactor")
        self.factors = set([factor.copy() for factor in factors_list])
def __init__ ( self , * factors_list ) : if not all ( isinstance ( phi , BaseFactor ) for phi in factors_list ) : raise TypeError ( "Input parameters must be child classes of BaseFactor" ) self . factors = set ( [ factor . copy ( ) for factor in factors_list ] )
Initialize the factor set class.

        Parameters
        ----------
        factors_list: Factor1, Factor2, ....
            All the factors whose product is represented by the factor set

        Examples
        --------
        >>> from pgmpy.factors import FactorSet
        >>> from pgmpy.factors.discrete import DiscreteFactor
        >>> phi1 = DiscreteFactor(['x1', 'x2', 'x3'], [2, 3, 2], range(12))
        >>> phi2 = DiscreteFactor(['x3', 'x4', 'x1'], [2, 2, 2], range(8))
        >>> factor_set = FactorSet(phi1, phi2)
        >>> factor_set
        <pgmpy.factors.FactorSet.FactorSet at 0x7f8e32af6d50>
        >>> print(factor_set)
        set([<DiscreteFactor representing phi(x1:2, x2:3, x3:2) at 0x7f8e32b4c2d0>,
             <DiscreteFactor representing phi(x3:2, x4:2, x1:2) at 0x7f8e32b4c710>])