class_docstr: Kernel Density Estimation
  
  Read more in the :ref:`User Guide <kernel_density>`.
  
  Parameters
  ----------
  bandwidth : float
      The bandwidth of the kernel.
  
  algorithm : string
      The tree algorithm to use.  Valid options are
      ['kd_tree'|'ball_tree'|'auto'].  Default is 'auto'.
  
  kernel : string
      The kernel to use.  Valid kernels are
      ['gaussian'|'tophat'|'epanechnikov'|'exponential'|'linear'|'cosine']
      Default is 'gaussian'.
  
  metric : string
      The distance metric to use.  Note that not all metrics are
      valid with all algorithms.  Refer to the documentation of
      :class:`BallTree` and :class:`KDTree` for a description of
      available algorithms.  Note that the normalization of the density
      output is correct only for the Euclidean distance metric. Default
      is 'euclidean'.
  
  atol : float
      The desired absolute tolerance of the result.  A larger tolerance will
      generally lead to faster execution. Default is 0.
  
  rtol : float
      The desired relative tolerance of the result.  A larger tolerance will
      generally lead to faster execution.  Default is 1E-8.
  
  breadth_first : boolean
      If true (default), use a breadth-first approach to the problem.
      Otherwise use a depth-first approach.
  
  leaf_size : int
      Specify the leaf size of the underlying tree.  See :class:`BallTree`
      or :class:`KDTree` for details.  Default is 40.
  
  metric_params : dict
      Additional parameters to be passed to the tree for use with the
      metric.  For more information, see the documentation of
      :class:`BallTree` or :class:`KDTree`.
code: def __init__(
      self,
      bandwidth=1.0,
      algorithm="auto",
      kernel="gaussian",
      metric="euclidean",
      atol=0,
      rtol=0,
      breadth_first=True,
      leaf_size=40,
      metric_params=None,
  ):
      self.algorithm = algorithm
      self.bandwidth = bandwidth
      self.kernel = kernel
      self.metric = metric
      self.atol = atol
      self.rtol = rtol
      self.breadth_first = breadth_first
      self.leaf_size = leaf_size
      self.metric_params = metric_params
  
      # run the choose algorithm code so that exceptions will happen here
      # we're using clone() in the GenerativeBayes classifier,
      # so we can't do this kind of logic in __init__
      self._choose_algorithm(self.algorithm, self.metric)
  
      if bandwidth <= 0:
          raise ValueError("bandwidth must be positive")
      if kernel not in VALID_KERNELS:
          raise ValueError("invalid kernel: '{0}'".format(kernel))
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/neighbors/kde.py
imports: import numpy
  from scipy.special import gammainc
  from ..base import BaseEstimator
  from ..utils import check_array, check_random_state
  from ..utils.extmath import row_norms
  from .ball_tree import BallTree, DTYPE
  from .kd_tree import KDTree
label_desc: Use image node_id 1 to create a new KernelDensity object from inherited base classes: BaseEstimator with example: obj = KernelDensity(bandwidth, algorithm, kernel, metric, atol, rtol, breadth_first, leaf_size, metric_params)