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
alpha: f64
Controls inverse power and difference scale.
ls: f64
Length scale controls scale of difference.
Methods
impl RationalQuadratic
[src]
fn new(alpha: f64, ls: f64) -> RationalQuadratic
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]
fn clone(&self) -> RationalQuadratic
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 RationalQuadratic
[src]
impl Debug for RationalQuadratic
[src]
impl Default for RationalQuadratic
[src]
The default Rational Qaudratic Kernel.
The defaults are:
- alpha = 1
- ls = 1
fn default() -> RationalQuadratic
Returns the "default value" for a type. Read more