Struct linfa::dataset::CountedTargets
source · pub struct CountedTargets<L: Label, P> { /* private fields */ }
Expand description
Targets with precomputed, counted labels
This extends plain targets with pre-counted labels. The label map is useful when, for example, a prior probability is estimated (e.g. in Naive Bayesian implementation) or the samples are weighted inverse to their occurence.
Fields
targets
: wrapped target fieldlabels
: counted labels with label-count association
Implementations§
Trait Implementations§
source§impl<L: Label, T: AsTargetsMut<Elem = L>> AsTargetsMut for CountedTargets<L, T>
impl<L: Label, T: AsTargetsMut<Elem = L>> AsTargetsMut for CountedTargets<L, T>
type Elem = L
type Ix = <T as AsTargetsMut>::Ix
fn as_targets_mut(&mut self) -> ArrayViewMut<'_, Self::Elem, Self::Ix>
source§impl<L: Clone + Label, P: Clone> Clone for CountedTargets<L, P>
impl<L: Clone + Label, P: Clone> Clone for CountedTargets<L, P>
source§fn clone(&self) -> CountedTargets<L, P>
fn clone(&self) -> CountedTargets<L, P>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, L: Label + 'a, T> FromTargetArray<'a> for CountedTargets<L, T>where
T: FromTargetArray<'a, Elem = L>,
T::Owned: Labels<Elem = L>,
T::View: Labels<Elem = L>,
impl<'a, L: Label + 'a, T> FromTargetArray<'a> for CountedTargets<L, T>where
T: FromTargetArray<'a, Elem = L>,
T::Owned: Labels<Elem = L>,
T::View: Labels<Elem = L>,
type Owned = CountedTargets<L, <T as FromTargetArray<'a>>::Owned>
type View = CountedTargets<L, <T as FromTargetArray<'a>>::View>
source§fn new_targets(targets: Array<L, T::Ix>) -> Self::Owned
fn new_targets(targets: Array<L, T::Ix>) -> Self::Owned
Create self object from new target array
fn new_targets_view(targets: ArrayView<'a, L, T::Ix>) -> Self::View
source§impl<L: Label, T: AsTargets<Elem = L>> Labels for CountedTargets<L, T>
impl<L: Label, T: AsTargets<Elem = L>> Labels for CountedTargets<L, T>
Counted labels can act as labels