class_docstr: Kernel Density Estimation. Computes a non-parametric density estimate
  from a finite data sample, smoothing the estimate according to a
  bandwidth parameter.
  
  Parameters
  ----------
  bandwidth : float, default=1.0
      The bandwidth of the kernel.
  kernel : {'gaussian', 'tophat', 'epanechnikov', 'exponential', 'linear',                  'cosine'}, default='gaussian'
      The kernel to use.
  metric : str, default='euclidean'
      The distance metric to use.  Note that not all metrics are
      valid with all algorithms. Note that the normalization of the density
      output is correct only for the Euclidean distance metric. Default
      is 'euclidean'.
  metric_params : dict, default=None
      Additional parameters to be passed to the tree for use with the
      metric.
  output_type : {'input', 'array', 'dataframe', 'series', 'df_obj',         'numba', 'cupy', 'numpy', 'cudf', 'pandas'}, default=None
      Return results and set estimator attributes to the indicated output
      type. If None, the output type set at the module level
      (`cuml.global_settings.output_type`) will be used. See
      :ref:`output-data-type-configuration` for more info.
  handle : cuml.Handle
      Specifies the cuml.handle that holds internal CUDA state for
      computations in this model. Most importantly, this specifies the
      CUDA stream that will be used for the model's computations, so
      users can run different models concurrently in different streams
      by creating handles in several streams.
      If it is None, a new one is created.
  verbose : int or boolean, default=False
      Sets logging level. It must be one of `cuml.common.logger.level_*`.
      See :ref:`verbosity-levels` for more info.
  
  Examples
  --------
  
  .. code-block:: python
  
      >>> from cuml.neighbors import KernelDensity
      >>> import cupy as cp
      >>> rng = cp.random.RandomState(42)
      >>> X = rng.random_sample((100, 3))
      >>> kde = KernelDensity(kernel='gaussian', bandwidth=0.5).fit(X)
      >>> log_density = kde.score_samples(X[:3])
class_docstr_tok: ["Kernel","Density","Estimation",".","Computes","a","non-parametric","density","estimate","from","a","finite","data","sample",",","smoothing","the","estimate","according","to","a","bandwidth","parameter",".","Parameters","--","--","--","--","--","bandwidth",":","float",",","default=1.0","The","bandwidth","of","the","kernel",".","kernel",":","{","'gaussian","'",",","'tophat","'",",","'epanechnikov","'",",","'exponential","'",",","'linear","'",",","'cosine","'","}",",","default='gaussian'","The","kernel","to","use",".","metric",":","str",",","default='euclidean'","The","distance","metric","to","use",".","Note","that","not","all","metrics","are","valid","with","all","algorithms",".","Note","that","the","normalization","of","the","density","output","is","correct","only","for","the","Euclidean","distance","metric",".","Default","is","'euclidean","'",".","metric_params",":","dict",",","default=None","Additional","parameters","to","be","passed","to","the","tree","for","use","with","the","metric",".","output_type",":","{","'input","'",",","'array","'",",","'dataframe","'",",","'series","'",",","'df_obj","'",",","'numba","'",",","'cupy","'",",","'numpy","'",",","'cudf","'",",","'pandas","'","}",",","default=None","Return","results","and","set","estimator","attributes","to","the","indicated","output","type",".","If","None",",","the","output","type","set","at","the","module","level","(","`","cuml.global_settings.output_type","`",")","will","be","used",".","See",":","ref",":","`","output-data-type-configuration","`","for","more","info",".","handle",":","cuml.Handle","Specifies","the","cuml.handle","that","holds","internal","CUDA","state","for","computations","in","this","model",".","Most","importantly",",","this","specifies","the","CUDA","stream","that","will","be","used","for","the","model","'s","computations",",","so","users","can","run","different","models","concurrently","in","different","streams","by","creating","handles","in","several","streams",".","If","it","is","None",",","a","new","one","is","created",".","verbose",":","int","or","boolean",",","default=False","Sets","logging","level",".","It","must","be","one","of","`","cuml.common.logger.level_","*","`",".","See",":","ref",":","`","verbosity-levels","`","for","more","info",".","Examples","--","--","--","--","..","code-block",":",":","python",">",">",">","from","cuml.neighbors","import","KernelDensity",">",">",">","import","cupy","as","cp",">",">",">","rng","=","cp.random.RandomState","(","42",")",">",">",">","X","=","rng.random_sample","(","(","100",",","3",")",")",">",">",">","kde","=","KernelDensity","(","kernel='gaussian","'",",","bandwidth=0.5",")",".fit","(","X",")",">",">",">","log_density","=","kde.score_samples","(","X","[",":3","]",")"]
code: def __init__(
      self,
      *,
      bandwidth=1.0,
      kernel="gaussian",
      metric="euclidean",
      metric_params=None,
      output_type=None,
      handle=None,
      verbose=False,
  ):
      super(KernelDensity, self).__init__(
          verbose=verbose, handle=handle, output_type=output_type
      )
      self.bandwidth = bandwidth
      self.kernel = kernel
      self.metric = metric
      self.metric_params = metric_params
  
      if bandwidth <= 0:
          raise ValueError("bandwidth must be positive")
      if kernel not in VALID_KERNELS:
          raise ValueError("invalid kernel: '{0}'".format(kernel))
  
imports: from cuml.common.exceptions import NotFittedError
  from cuml.internals.import_utils import has_scipy
  from cuml.metrics import pairwise_distances
  from cuml.internals.base import Base
  from cuml.internals.input_utils import input_to_cuml_array
  from cuml.internals.input_utils import input_to_cupy_array
  from cuml.internals.safe_imports import gpu_only_import_from
  import math
  from cuml.internals.safe_imports import cpu_only_import
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 1 to create a new KernelDensity object from inherited base classes: Base with example: obj = KernelDensity()