[−][src]Struct linfa_kernel::Kernel
A generic kernel
Fields
inner: KernelInner<R::Elem>
fnc: Box<dyn Fn(ArrayView1<'_, R::Elem>, ArrayView1<'_, R::Elem>) -> R::Elem>
dataset: R
linear: bool
Implementations
impl<'a, F: Float> Kernel<ArrayView2<'a, F>>
[src]
pub fn new<G: Fn(ArrayView1<'_, F>, ArrayView1<'_, F>) -> F + 'static>(
dataset: ArrayView2<'a, F>,
fnc: G,
kind: KernelType,
linear: bool
) -> Kernel<ArrayView2<'a, F>>
[src]
dataset: ArrayView2<'a, F>,
fnc: G,
kind: KernelType,
linear: bool
) -> Kernel<ArrayView2<'a, F>>
pub fn dot(&self, rhs: &ArrayView2<'_, F>) -> Array2<F>
[src]
pub fn sum(&self) -> Array1<F>
[src]
pub fn size(&self) -> usize
[src]
pub fn to_upper_triangle(&self) -> Vec<F>
[src]
pub fn diagonal(&self) -> Array1<F>
[src]
pub fn column(&self, i: usize) -> Vec<F>
[src]
pub fn weighted_sum(&self, weights: &[F], sample: ArrayView1<'_, F>) -> F
[src]
pub fn is_linear(&self) -> bool
[src]
pub fn params() -> KernelParams<F>
[src]
Trait Implementations
impl<'a, F: Float> Records for Kernel<ArrayView2<'a, F>>
[src]
type Elem = F
pub fn observations(&self) -> usize
[src]
impl<'a, F: Float> Transformer<&'a ArrayBase<OwnedRepr<F>, Dim<[usize; 2]>>, Kernel<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>>> for KernelParams<F>
[src]
pub fn transform(&self, x: &'a Array2<F>) -> Kernel<ArrayView2<'a, F>>
[src]
impl<'a, F: Float> Transformer<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>, Kernel<ArrayBase<ViewRepr<&'a F>, Dim<[usize; 2]>>>> for KernelParams<F>
[src]
pub fn transform(&self, x: ArrayView2<'a, F>) -> Kernel<ArrayView2<'a, F>>
[src]
Auto Trait Implementations
impl<R> !RefUnwindSafe for Kernel<R>
impl<R> !Send for Kernel<R>
impl<R> !Sync for Kernel<R>
impl<R> Unpin for Kernel<R> where
R: Unpin,
<R as Records>::Elem: Unpin,
R: Unpin,
<R as Records>::Elem: Unpin,
impl<R> !UnwindSafe for Kernel<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,