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>
impl<'a, L: Label + 'a, T> FromTargetArray<'a> for CountedTargets<L, T>
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
source§impl<L: PartialEq + Label, P: PartialEq> PartialEq for CountedTargets<L, P>
impl<L: PartialEq + Label, P: PartialEq> PartialEq for CountedTargets<L, P>
source§fn eq(&self, other: &CountedTargets<L, P>) -> bool
fn eq(&self, other: &CountedTargets<L, P>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<L: Eq + Label, P: Eq> Eq for CountedTargets<L, P>
impl<L: Label, P> StructuralEq for CountedTargets<L, P>
impl<L: Label, P> StructuralPartialEq for CountedTargets<L, P>
Auto Trait Implementations§
impl<L, P> RefUnwindSafe for CountedTargets<L, P>where
L: RefUnwindSafe,
P: RefUnwindSafe,
impl<L, P> Send for CountedTargets<L, P>
impl<L, P> Sync for CountedTargets<L, P>
impl<L, P> Unpin for CountedTargets<L, P>
impl<L, P> UnwindSafe for CountedTargets<L, P>where
L: UnwindSafe,
P: UnwindSafe,
Blanket Implementations§
source§impl<T> AsMultiTargets for T
impl<T> AsMultiTargets for T
fn as_multi_targets(&self) -> ArrayView2<'_, Self::Elem>
source§impl<T> AsMultiTargetsMut for T
impl<T> AsMultiTargetsMut for T
fn as_multi_targets_mut(&mut self) -> ArrayViewMut2<'_, Self::Elem>
source§impl<T> AsSingleTargets for T
impl<T> AsSingleTargets for T
fn as_single_targets(&self) -> ArrayView1<'_, Self::Elem>
source§impl<T> AsSingleTargetsMut for T
impl<T> AsSingleTargetsMut for T
fn as_single_targets_mut(&mut self) -> ArrayViewMut1<'_, Self::Elem>
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more