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

pub struct RationalQuadratic {
    pub alpha: f64,
    pub ls: f64,
}

The Rational Quadratic Kernel.

k(x,y) = (1 + ||x-y||2 / (2αl2))

Fields

Controls inverse power and difference scale.

Length scale controls scale of difference.

Methods

impl RationalQuadratic
[src]

Constructs a new Rational Quadratic Kernel.

Examples

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

// Construct a kernel with alpha = 2, ls = 2.
let ker = kernel::RationalQuadratic::new(2.0, 2.0);

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

Trait Implementations

impl Clone for RationalQuadratic
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for RationalQuadratic
[src]

impl Debug for RationalQuadratic
[src]

Formats the value using the given formatter.

impl Default for RationalQuadratic
[src]

The default Rational Qaudratic Kernel.

The defaults are:

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

impl Kernel for RationalQuadratic
[src]

The kernel function. Read more