class_docstr: Base class of *DiscreteFactor Sets*.
  
  A factor set provides a compact representation of  higher dimensional factor
  :math:`\phi_1\cdot\phi_2\cdots\phi_n`
  
  For example the factor set corresponding to factor :math:`\phi_1\cdot\phi_2` would be the union of the factors
  :math:`\phi_1` and :math:`\phi_2` i.e. factor set :math:`\vec\phi = \phi_1 \cup \phi_2`.
class_docstr_tok: ["Base","class","of","*","DiscreteFactor","Sets","*",".","A","factor","set","provides","a","compact","representation","of","higher","dimensional","factor",":","math",":","`","\\phi_1\\cdot\\phi_2\\cdots\\phi_n","`","For","example","the","factor","set","corresponding","to","factor",":","math",":","`","\\phi_1\\cdot\\phi_2","`","would","be","the","union","of","the","factors",":","math",":","`","\\phi_1","`","and",":","math",":","`","\\phi_2","`","i.e",".","factor","set",":","math",":","`","\\vec\\phi","=","\\phi_1","\\cup","\\phi_2","`","."]
docstr: 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>])
docstr_tok: ["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",">","]",")"]
code: 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])
  
file_path: pgmpy/pgmpy/factors/FactorSet.py
imports: from functools import reduce
  from pgmpy.factors.base import BaseFactor
label_desc: Use image node_id 1 to create a new FactorSet object from inherited base classes: object with example: obj = FactorSet()