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

pub struct Linear {
    pub c: f64,
}

The Linear Kernel

k(x,y) = xTy + c

Fields

Constant term added to inner product.

Methods

impl Linear
[src]

Constructs a new Linear Kernel.

Examples

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

let ker = kernel::Linear::new(5.0);

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

Trait Implementations

impl Clone for Linear
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Linear
[src]

impl Debug for Linear
[src]

Formats the value using the given formatter.

impl Default for Linear
[src]

Constructs the default Linear Kernel

The defaults are:

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

impl Kernel for Linear
[src]

The kernel function. Read more