Trait hyperopt::kernel::Kernel

source ·
pub trait Kernel {
    type Param;

    // Required method
    fn new(location: Self::Param, bandwidth: Self::Param) -> Self;

    // Provided method
    fn from_triple(triple: Triple<Self::Param>) -> Option<Self>
       where Self: Sized,
             Self::Param: Copy + Ord + Additive { ... }
}
Expand description

A single kernel of a kernel density estimator.

Note that it does not directly correspond to the mathematical definition, as for example, it is responsible for its own shift and scaling. This is useful for discrete kernels which do not normally have a bandwidth parameter h.

Required Associated Types§

Required Methods§

source

fn new(location: Self::Param, bandwidth: Self::Param) -> Self

Construct a kernel with the given location and bandwidth.

Provided Methods§

source

fn from_triple(triple: Triple<Self::Param>) -> Option<Self>
where Self: Sized, Self::Param: Copy + Ord + Additive,

Construct the kernel for the triple of adjacent trials.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<P, D> Kernel for Binomial<P, D>
where Self: Density<Param = P, Output = D> + Sample<Param = P>, P: Copy + Ord + MaxN + Additive + Multiplicative + Into<D> + One, D: Multiplicative,

§

type Param = P

source§

impl<P, D> Kernel for Uniform<P, D>
where Self: Density<Param = P, Output = D> + Sample<Param = P>, P: Copy + Additive + Multiplicative + Into<f64> + From<f64> + PartialOrd + Zero,

§

type Param = P

source§

impl<T> Kernel for Epanechnikov<T>
where Self: Density<Param = T, Output = T> + Sample<Param = T>, T: PartialOrd + Zero,

§

type Param = T

source§

impl<T> Kernel for Gaussian<T>
where Self: Density<Param = T, Output = T> + Sample<Param = T>, T: PartialOrd + Zero,

§

type Param = T