class_docstr: Base class for factors representing various multivariate
  representations.
docstr: Reduces the factor to the context of the given variable values.
  
  Parameters
  ----------
  values: list, array-like
      A list of tuples of the form (variable_name, variable_value).
  
  inplace: boolean
      If inplace=True it will modify the factor itself, else would return
      a new ContinuousFactor object.
  
  Returns
  -------
  ContinuousFactor or None: if inplace=True (default) returns None
                            if inplace=False returns a new ContinuousFactor instance.
  
  Examples
  --------
  >>> import numpy as np
  >>> from scipy.special import beta
  >>> from pgmpy.factors.continuous import ContinuousFactor
  >>> def custom_pdf(x, y, z):
  ...     return z*(np.power(x, 1) * np.power(y, 2)) / beta(x, y)
  >>> custom_factor = ContinuousFactor(['x', 'y', 'z'], custom_pdf)
  >>> custom_factor.variables
  ['x', 'y', 'z']
  >>> custom_factor.assignment(1, 2, 3)
  24.0
  
  >>> custom_factor.reduce([('y', 2)])
  >>> custom_factor.variables
  ['x', 'z']
  >>> custom_factor.assignment(1, 3)
  24.0
docstr_tok: ["Reduces","the","factor","to","the","context","of","the","given","variable","values",".","Parameters","--","--","--","--","--","values",":","list",",","array-like","A","list","of","tuples","of","the","form","(","variable_name",",","variable_value",")",".","inplace",":","boolean","If","inplace=True","it","will","modify","the","factor","itself",",","else","would","return","a","new","ContinuousFactor","object",".","Returns","--","--","--","-","ContinuousFactor","or","None",":","if","inplace=True","(","default",")","returns","None","if","inplace=False","returns","a","new","ContinuousFactor","instance",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","scipy.special","import","beta",">",">",">","from","pgmpy.factors.continuous","import","ContinuousFactor",">",">",">","def","custom_pdf","(","x",",","y",",","z",")",":","...","return","z","*","(","np.power","(","x",",","1",")","*","np.power","(","y",",","2",")",")","\/","beta","(","x",",","y",")",">",">",">","custom_factor","=","ContinuousFactor","(","[","'","x","'",",","'","y","'",",","'","z","'","]",",","custom_pdf",")",">",">",">","custom_factor.variables","[","'","x","'",",","'","y","'",",","'","z","'","]",">",">",">","custom_factor.assignment","(","1",",","2",",","3",")","24.0",">",">",">","custom_factor.reduce","(","[","(","'","y","'",",","2",")","]",")",">",">",">","custom_factor.variables","[","'","x","'",",","'","z","'","]",">",">",">","custom_factor.assignment","(","1",",","3",")","24.0"]
code: def reduce(self, values, inplace=True):
      """
      Reduces the factor to the context of the given variable values.
  
      Parameters
      ----------
      values: list, array-like
          A list of tuples of the form (variable_name, variable_value).
  
      inplace: boolean
          If inplace=True it will modify the factor itself, else would return
          a new ContinuousFactor object.
  
      Returns
      -------
      ContinuousFactor or None: if inplace=True (default) returns None
                                if inplace=False returns a new ContinuousFactor instance.
  
      Examples
      --------
      >>> import numpy as np
      >>> from scipy.special import beta
      >>> from pgmpy.factors.continuous import ContinuousFactor
      >>> def custom_pdf(x, y, z):
      ...     return z*(np.power(x, 1) * np.power(y, 2)) / beta(x, y)
      >>> custom_factor = ContinuousFactor(['x', 'y', 'z'], custom_pdf)
      >>> custom_factor.variables
      ['x', 'y', 'z']
      >>> custom_factor.assignment(1, 2, 3)
      24.0
  
      >>> custom_factor.reduce([('y', 2)])
      >>> custom_factor.variables
      ['x', 'z']
      >>> custom_factor.assignment(1, 3)
      24.0
      """
      phi = self if inplace else self.copy()
  
      phi.distribution = phi.distribution.reduce(values, inplace=False)
      if not inplace:
          return phi
  
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 9 for calling the ContinuousFactor obj's underlying member method code with example usage: obj.reduce(values, inplace) and returns: phi