KernelFunction

Trait KernelFunction 

Source
pub trait KernelFunction {
    // Required method
    fn compute(&self, x1: &Array1<f64>, x2: &Array1<f64>) -> Result<f64>;

    // Provided method
    fn compute_matrix(&self, x: &Array2<f64>) -> Result<Array2<f64>> { ... }
}
Expand description

Kernel function for machine learning

Required Methods§

Source

fn compute(&self, x1: &Array1<f64>, x2: &Array1<f64>) -> Result<f64>

Computes the kernel value for two vectors

Provided Methods§

Source

fn compute_matrix(&self, x: &Array2<f64>) -> Result<Array2<f64>>

Computes the kernel matrix for a dataset

Implementors§