pub enum KernelType {
Linear,
Rbf {
gamma: f64,
},
Polynomial {
gamma: f64,
coef0: f64,
degree: f64,
},
Sigmoid {
gamma: f64,
coef0: f64,
},
Precomputed,
Custom(String),
Cosine,
ChiSquared {
gamma: f64,
},
Intersection,
Hellinger,
JensenShannon,
Periodic {
length_scale: f64,
period: f64,
},
}Expand description
Main kernel type enumeration
Variants§
Linear
Linear kernel: K(x,y) = x^T y
Rbf
RBF/Gaussian kernel: K(x,y) = exp(-γ||x-y||²)
Polynomial
Polynomial kernel: K(x,y) = (γ x^T y + r)^d
Sigmoid
Sigmoid kernel: K(x,y) = tanh(γ x^T y + r)
Precomputed
Precomputed kernel matrix
Custom(String)
Custom user-defined kernel
Cosine
Cosine similarity kernel
ChiSquared
Chi-squared kernel
Intersection
Histogram intersection kernel
Hellinger
Hellinger kernel
JensenShannon
Jensen-Shannon kernel
Periodic
Periodic kernel
Trait Implementations§
Source§impl Clone for KernelType
impl Clone for KernelType
Source§fn clone(&self) -> KernelType
fn clone(&self) -> KernelType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelType
impl Debug for KernelType
Source§impl Kernel for KernelType
Implement Kernel trait for KernelType to enable direct usage
impl Kernel for KernelType
Implement Kernel trait for KernelType to enable direct usage
Source§fn compute(&self, x: ArrayView1<'_, f64>, y: ArrayView1<'_, f64>) -> f64
fn compute(&self, x: ArrayView1<'_, f64>, y: ArrayView1<'_, f64>) -> f64
Compute kernel value between two vectors
Source§impl PartialEq for KernelType
impl PartialEq for KernelType
impl StructuralPartialEq for KernelType
Auto Trait Implementations§
impl Freeze for KernelType
impl RefUnwindSafe for KernelType
impl Send for KernelType
impl Sync for KernelType
impl Unpin for KernelType
impl UnwindSafe for KernelType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more