Trait linfa::dataset::FromTargetArray
source · pub trait FromTargetArray<'a>: AsTargets {
type Owned;
type View;
// Required methods
fn new_targets(targets: Array<Self::Elem, Self::Ix>) -> Self::Owned;
fn new_targets_view(
targets: ArrayView<'a, Self::Elem, Self::Ix>
) -> Self::View;
}
Expand description
Helper trait to construct counted labels
This is implemented for objects which can act as targets and created from a target matrix. For
targets represented as ndarray
matrix this is identity, for counted labels, i.e.
TargetsWithLabels
, it creates the corresponding wrapper struct.
Required Associated Types§
Required Methods§
sourcefn new_targets(targets: Array<Self::Elem, Self::Ix>) -> Self::Owned
fn new_targets(targets: Array<Self::Elem, Self::Ix>) -> Self::Owned
Create self object from new target array
fn new_targets_view(targets: ArrayView<'a, Self::Elem, Self::Ix>) -> Self::View
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'a, L: Clone + 'a, S: Data<Elem = L>, I: TargetDim> FromTargetArray<'a> for ArrayBase<S, I>
impl<'a, L: Clone + 'a, S: Data<Elem = L>, I: TargetDim> FromTargetArray<'a> for ArrayBase<S, I>
source§fn new_targets(targets: Array<L, I>) -> Self::Owned
fn new_targets(targets: Array<L, I>) -> Self::Owned
Returns an owned representation of the target array
source§fn new_targets_view(targets: ArrayView<'a, L, I>) -> Self::View
fn new_targets_view(targets: ArrayView<'a, L, I>) -> Self::View
Returns a reference to the target array