class_docstr: Base class for Joint Probability Distribution
class_docstr_tok: ["Base","class","for","Joint","Probability","Distribution"]
docstr: Returns JointProbabilityDistribution as a DiscreteFactor object
  
  Examples
  --------
  >>> import numpy as np
  >>> from pgmpy.factors.discrete import JointProbabilityDistribution
  >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 3, 2], np.ones(12)/12)
  >>> phi = prob.to_factor()
  >>> type(phi)
  pgmpy.factors.DiscreteFactor.DiscreteFactor
docstr_tok: ["Returns","JointProbabilityDistribution","as","a","DiscreteFactor","object","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","pgmpy.factors.discrete","import","JointProbabilityDistribution",">",">",">","prob","=","JointProbabilityDistribution","(","[","'x1","'",",","'x2","'",",","'x3","'","]",",","[","2",",","3",",","2","]",",","np.ones","(","12",")","\/12",")",">",">",">","phi","=","prob.to_factor","(",")",">",">",">","type","(","phi",")","pgmpy.factors.DiscreteFactor.DiscreteFactor"]
code: def to_factor(self):
      """
      Returns JointProbabilityDistribution as a DiscreteFactor object
  
      Examples
      --------
      >>> import numpy as np
      >>> from pgmpy.factors.discrete import JointProbabilityDistribution
      >>> prob = JointProbabilityDistribution(['x1', 'x2', 'x3'], [2, 3, 2], np.ones(12)/12)
      >>> phi = prob.to_factor()
      >>> type(phi)
      pgmpy.factors.DiscreteFactor.DiscreteFactor
      """
      return DiscreteFactor(
          self.variables, self.cardinality, self.values
      )
  
file_path: pgmpy/pgmpy/factors/discrete/JointProbabilityDistribution.py
imports: import itertools
  from functools import reduce
  from operator import mul
  import numpy
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.independencies import Independencies
label_desc: Use image node_id 11 for calling the JointProbabilityDistribution obj's underlying member method code with example usage: obj.to_factor() and returns: DiscreteFactor