Struct rusty_machine::learning::toolkit::kernel::Multiquadric
source · [−]pub struct Multiquadric {
pub c: f64,
}
Expand description
The Multiquadric Kernel.
k(x,y) = sqrt(||x-y||2 + c2)
Fields
c: f64
Constant added to square of difference.
Implementations
sourceimpl Multiquadric
impl Multiquadric
sourcepub fn new(c: f64) -> Multiquadric
pub fn new(c: f64) -> Multiquadric
Constructs a new Multiquadric Kernel.
Examples
use rusty_machine::learning::toolkit::kernel;
use rusty_machine::learning::toolkit::kernel::Kernel;
// Construct a kernel with c = 2.
let ker = kernel::Multiquadric::new(2.0);
println!("{0}", ker.kernel(&[1.,2.,3.], &[3.,4.,5.]));
Trait Implementations
sourceimpl Clone for Multiquadric
impl Clone for Multiquadric
sourcefn clone(&self) -> Multiquadric
fn clone(&self) -> Multiquadric
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for Multiquadric
impl Debug for Multiquadric
sourceimpl Default for Multiquadric
impl Default for Multiquadric
Constructs a default Multiquadric Kernel.
The defaults are:
- c = 0
sourcefn default() -> Multiquadric
fn default() -> Multiquadric
Returns the “default value” for a type. Read more
sourceimpl Kernel for Multiquadric
impl Kernel for Multiquadric
impl Copy for Multiquadric
Auto Trait Implementations
impl RefUnwindSafe for Multiquadric
impl Send for Multiquadric
impl Sync for Multiquadric
impl Unpin for Multiquadric
impl UnwindSafe for Multiquadric
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more