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

pub struct Polynomial {
    pub alpha: f64,
    pub c: f64,
    pub d: f64,
}

The Polynomial Kernel

k(x,y) = (αxTy + c)d

Fields

Scaling of the inner product.

Constant added to inner product.

The power to raise the sum to.

Methods

impl Polynomial
[src]

Constructs a new Polynomial Kernel.

Examples

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

// Constructs a new polynomial with alpha = 1, c = 0, d = 2.
let ker = kernel::Polynomial::new(1.0, 0.0, 2.0);

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

Trait Implementations

impl Clone for Polynomial
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Polynomial
[src]

impl Debug for Polynomial
[src]

Formats the value using the given formatter.

impl Default for Polynomial
[src]

Construct a new polynomial kernel.

The defaults are:

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

impl Kernel for Polynomial
[src]

The kernel function. Read more