Trait linfa::dataset::AsTargets[][src]

pub trait AsTargets {
    type Elem;
    fn as_multi_targets(&self) -> ArrayView2<'_, Self::Elem>;

    fn try_single_target(&self) -> Result<ArrayView1<'_, Self::Elem>> { ... }
}

Return a reference to single or multiple target variables

Associated Types

Loading content...

Required methods

fn as_multi_targets(&self) -> ArrayView2<'_, Self::Elem>[src]

Returns a view on targets as two-dimensional array

Loading content...

Provided methods

fn try_single_target(&self) -> Result<ArrayView1<'_, Self::Elem>>[src]

Convert to single target, fails for more than one target

Returns

May return a single target with the same label type, but returns an Error::MultipleTargets in case that there are more than a single target.

Loading content...

Implementations on Foreign Types

impl<'a, L, S: Data<Elem = L>> AsTargets for ArrayBase<S, Ix1>[src]

type Elem = L

impl<L, S: Data<Elem = L>> AsTargets for ArrayBase<S, Ix2>[src]

type Elem = L

impl<T: AsTargets> AsTargets for &T[src]

type Elem = T::Elem

Loading content...

Implementors

impl<L, R: Records, T: AsTargets<Elem = L>> AsTargets for DatasetBase<R, T>[src]

type Elem = L

impl<L: Label, T: AsTargets<Elem = L>> AsTargets for CountedTargets<L, T>[src]

type Elem = L

Loading content...