pub struct CustomPolynomialKernel {
pub gamma: Float,
pub coef0: Float,
pub degree: u32,
}Expand description
Custom polynomial kernel CustomPolynomialKernel
Fields§
§gamma: Floatgamma
coef0: Floatcoef0
degree: u32degree
Implementations§
Trait Implementations§
Source§impl Clone for CustomPolynomialKernel
impl Clone for CustomPolynomialKernel
Source§fn clone(&self) -> CustomPolynomialKernel
fn clone(&self) -> CustomPolynomialKernel
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 CustomPolynomialKernel
impl Debug for CustomPolynomialKernel
Source§impl KernelFunction for CustomPolynomialKernel
impl KernelFunction for CustomPolynomialKernel
Source§fn kernel(&self, x: &[Float], y: &[Float]) -> Float
fn kernel(&self, x: &[Float], y: &[Float]) -> Float
Compute the kernel value between two vectors
Source§fn fourier_transform(&self, w: &[Float]) -> Float
fn fourier_transform(&self, w: &[Float]) -> Float
Get the characteristic function of the kernel’s Fourier transform
This should return the Fourier transform of the kernel at frequency w
For most kernels, this is needed to generate appropriate random features
Source§fn sample_frequencies(
&self,
n_features: usize,
n_components: usize,
rng: &mut RealStdRng,
) -> Array2<Float>
fn sample_frequencies( &self, n_features: usize, n_components: usize, rng: &mut RealStdRng, ) -> Array2<Float>
Sample random frequencies for Random Fourier Features
This method should sample frequencies according to the spectral measure
of the kernel (i.e., the Fourier transform of the kernel)
Source§fn description(&self) -> String
fn description(&self) -> String
Get a description of the kernel
Auto Trait Implementations§
impl Freeze for CustomPolynomialKernel
impl RefUnwindSafe for CustomPolynomialKernel
impl Send for CustomPolynomialKernel
impl Sync for CustomPolynomialKernel
impl Unpin for CustomPolynomialKernel
impl UnwindSafe for CustomPolynomialKernel
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