Struct rusty_machine::learning::toolkit::kernel::Multiquadric [] [src]

pub struct Multiquadric {
    pub c: f64,
}

The Multiquadric Kernel.

k(x,y) = sqrt(||x-y||2 + c2)

Fields

c: f64

Constant added to square of difference.

Methods

impl Multiquadric
[src]

fn new(c: f64) -> Multiquadric

Constructs a new Multiquadric Kernel.

Examples

use rusty_machine::learning::toolkit::kernel;
use rusty_machine::learning::toolkit::kernel::Kernel;

// Construct a kernel with c = 2.
let ker = kernel::Multiquadric::new(2.0);

println!("{0}", ker.kernel(&[1.,2.,3.], &[3.,4.,5.]));

Trait Implementations

impl Debug for Multiquadric
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for Multiquadric
[src]

impl Clone for Multiquadric
[src]

fn clone(&self) -> Multiquadric

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for Multiquadric
[src]

Constructs a default Multiquadric Kernel.

The defaults are:

fn default() -> Multiquadric

Returns the "default value" for a type. Read more

impl Kernel for Multiquadric
[src]

fn kernel(&self, x1: &[f64], x2: &[f64]) -> f64

The kernel function. Read more