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
alpha: f64
Scaling of the inner product.
c: f64
Constant added to inner product.
d: f64
The power to raise the sum to.
Methods
impl Polynomial
[src]
fn new(alpha: f64, c: f64, d: f64) -> Polynomial
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]
fn clone(&self) -> Polynomial
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 Copy for Polynomial
[src]
impl Debug for Polynomial
[src]
impl Default for Polynomial
[src]
Construct a new polynomial kernel.
The defaults are:
- alpha = 1
- c = 0
- d = 1
fn default() -> Polynomial
Returns the "default value" for a type. Read more