class_docstr: This class uses the unbiased method for discretizing the
  given continuous distribution.
  
  The unbiased method for discretization is the matching of the
  first moment method. It involves calculating the first order
  limited moment of the distribution which is done by the _lim_moment
  method.
  
  For this method,
  
  The probability mass is,
  (E(x) - E(x + step))/step + 1 - cdf(x), for x = low
  
  (2 * E(x) - E(x - step) - E(x + step))/step, for low < x < high
  
  (E(x) - E(x - step))/step - 1 + cdf(x), for x = high
  
  where, E(x) is the first limiting moment of the distribution
  about the point x, cdf is the cumulative density function
  and step = (high-low)/cardinality.
  
  References
  ----------
  Klugman, S. A., Panjer, H. H. and Willmot, G. E.,
  Loss Models, From Data to Decisions, Fourth Edition,
  Wiley, section 9.6.5.2 (Method of local moment matching) and
  exercise 9.41.
  
  Examples
  --------
  >>> import numpy as np
  >>> from pgmpy.factors import ContinuousNode
  >>> from pgmpy.factors.continuous import UnbiasedDiscretizer
  # exponential distribution with rate = 2
  >>> exp_pdf = lambda x: 2*np.exp(-2*x) if x>=0 else 0
  >>> exp_node = ContinuousNode(exp_pdf)
  >>> exp_node.discretize(UnbiasedDiscretizer, low=0, high=5, cardinality=10)
  [0.39627368905806137, 0.4049838434034298, 0.13331784003148325,
   0.043887287876647259, 0.014447413395300212, 0.0047559685431339703,
   0.0015656350182896128, 0.00051540201980112557, 0.00016965346326140994,
   3.7867260839208328e-05]
class_docstr_tok: ["This","class","uses","the","unbiased","method","for","discretizing","the","given","continuous","distribution",".","The","unbiased","method","for","discretization","is","the","matching","of","the","first","moment","method",".","It","involves","calculating","the","first","order","limited","moment","of","the","distribution","which","is","done","by","the","_lim_moment","method",".","For","this","method",",","The","probability","mass","is",",","(","E","(","x",")","-","E","(","x","+","step",")",")","\/step","+","1","-","cdf","(","x",")",",","for","x","=","low","(","2","*","E","(","x",")","-","E","(","x","-","step",")","-","E","(","x","+","step",")",")","\/step",",","for","low","<","x","<","high","(","E","(","x",")","-","E","(","x","-","step",")",")","\/step","-","1","+","cdf","(","x",")",",","for","x","=","high","where",",","E","(","x",")","is","the","first","limiting","moment","of","the","distribution","about","the","point","x",",","cdf","is","the","cumulative","density","function","and","step","=","(","high-low",")","\/cardinality",".","References","--","--","--","--","--","Klugman",",","S.","A.",",","Panjer",",","H.","H.","and","Willmot",",","G.","E.",",","Loss","Models",",","From","Data","to","Decisions",",","Fourth","Edition",",","Wiley",",","section","9.6.5.2","(","Method","of","local","moment","matching",")","and","exercise","9.41",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","pgmpy.factors","import","ContinuousNode",">",">",">","from","pgmpy.factors.continuous","import","UnbiasedDiscretizer","#","exponential","distribution","with","rate","=","2",">",">",">","exp_pdf","=","lambda","x",":","2","*","np.exp","(","-2","*","x",")","if","x",">","=0","else","0",">",">",">","exp_node","=","ContinuousNode","(","exp_pdf",")",">",">",">","exp_node.discretize","(","UnbiasedDiscretizer",",","low=0",",","high=5",",","cardinality=10",")","[","0.39627368905806137",",","0.4049838434034298",",","0.13331784003148325",",","0.043887287876647259",",","0.014447413395300212",",","0.0047559685431339703",",","0.0015656350182896128",",","0.00051540201980112557",",","0.00016965346326140994",",","3.7867260839208328e-05","]"]
code: def get_labels(self):
      labels = list(
          f"x={str(i)}"
          for i in np.round(
              np.linspace(self.low, self.high, self.cardinality), 3
          )
      )
      return labels
  
file_path: pgmpy/pgmpy/factors/continuous/discretize.py
imports: from abc import ABCMeta, abstractmethod
  import numpy
  from scipy import integrate
label_desc: Use image node_id 3 for calling the UnbiasedDiscretizer obj's underlying member method code with example usage: obj.get_labels() and returns: labels