class_docstr: Base class for factors representing various multivariate
  representations.
docstr: Discretizes the continuous distribution into discrete
  probability masses using various methods.
  
  Parameters
  ----------
  method : A Discretizer Class from pgmpy.discretize
  
  *args, **kwargs:
      The parameters to be given to the Discretizer Class.
  
  Returns
  -------
  An n-D array or a DiscreteFactor object according to the discretiztion
  method used.
  
  Examples
  --------
  >>> import numpy as np
  >>> from scipy.special import beta
  >>> from pgmpy.factors.continuous import ContinuousFactor
  >>> from pgmpy.factors.continuous import RoundingDiscretizer
  >>> def dirichlet_pdf(x, y):
  ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
  >>> dirichlet_factor = ContinuousFactor(['x', 'y'], dirichlet_pdf)
  >>> dirichlet_factor.discretize(RoundingDiscretizer, low=1, high=2, cardinality=5)
  # TODO: finish this
docstr_tok: ["Discretizes","the","continuous","distribution","into","discrete","probability","masses","using","various","methods",".","Parameters","--","--","--","--","--","method",":","A","Discretizer","Class","from","pgmpy.discretize","*","args",",","*","*","kwargs",":","The","parameters","to","be","given","to","the","Discretizer","Class",".","Returns","--","--","--","-","An","n-D","array","or","a","DiscreteFactor","object","according","to","the","discretiztion","method","used",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","scipy.special","import","beta",">",">",">","from","pgmpy.factors.continuous","import","ContinuousFactor",">",">",">","from","pgmpy.factors.continuous","import","RoundingDiscretizer",">",">",">","def","dirichlet_pdf","(","x",",","y",")",":","...","return","(","np.power","(","x",",","1",")","*","np.power","(","y",",","2",")",")","\/","beta","(","x",",","y",")",">",">",">","dirichlet_factor","=","ContinuousFactor","(","[","'","x","'",",","'","y","'","]",",","dirichlet_pdf",")",">",">",">","dirichlet_factor.discretize","(","RoundingDiscretizer",",","low=1",",","high=2",",","cardinality=5",")","#","TODO",":","finish","this"]
code: def discretize(self, method, *args, **kwargs):
      """
      Discretizes the continuous distribution into discrete
      probability masses using various methods.
  
      Parameters
      ----------
      method : A Discretizer Class from pgmpy.discretize
  
      *args, **kwargs:
          The parameters to be given to the Discretizer Class.
  
      Returns
      -------
      An n-D array or a DiscreteFactor object according to the discretiztion
      method used.
  
      Examples
      --------
      >>> import numpy as np
      >>> from scipy.special import beta
      >>> from pgmpy.factors.continuous import ContinuousFactor
      >>> from pgmpy.factors.continuous import RoundingDiscretizer
      >>> def dirichlet_pdf(x, y):
      ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
      >>> dirichlet_factor = ContinuousFactor(['x', 'y'], dirichlet_pdf)
      >>> dirichlet_factor.discretize(RoundingDiscretizer, low=1, high=2, cardinality=5)
      # TODO: finish this
      """
      return method(self, *args, **kwargs).get_discrete_values()
  
imports: import types
  import numpy
  import scipy.integrate
  from pgmpy.factors.base import BaseFactor
  from pgmpy.factors.distributions import GaussianDistribution, CustomDistribution
label_desc: Use image node_id 8 for calling the ContinuousFactor obj's underlying member method code with example usage: obj.discretize(method) and returns: method