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
sourceimpl<L: Label, T: AsTargets<Elem = L>> AsTargets for CountedTargets<L, T>
impl<L: Label, T: AsTargets<Elem = L>> AsTargets for CountedTargets<L, T>
sourceimpl<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>
sourceimpl<L: Clone + Label, P: Clone> Clone for CountedTargets<L, P>
impl<L: Clone + Label, P: Clone> Clone for CountedTargets<L, P>
sourcefn clone(&self) -> CountedTargets<L, P>
fn clone(&self) -> CountedTargets<L, P>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'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>
sourcefn 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
sourceimpl<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
sourceimpl<L: PartialEq + Label, P: PartialEq> PartialEq<CountedTargets<L, P>> for CountedTargets<L, P>
impl<L: PartialEq + Label, P: PartialEq> PartialEq<CountedTargets<L, P>> for CountedTargets<L, P>
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &CountedTargets<L, P>) -> bool
fn ne(&self, other: &CountedTargets<L, P>) -> bool
This method tests for !=
.
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> where
L: Send,
P: Send,
impl<L, P> Sync for CountedTargets<L, P> where
L: Sync,
P: Sync,
impl<L, P> Unpin for CountedTargets<L, P> where
L: Unpin,
P: Unpin,
impl<L, P> UnwindSafe for CountedTargets<L, P> where
L: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> AsMultiTargets for T where
T: AsTargets<Ix = Dim<[usize; 2]>>,
impl<T> AsMultiTargets for T where
T: AsTargets<Ix = Dim<[usize; 2]>>,
fn as_multi_targets(&self) -> ArrayView2<'_, Self::Elem>
sourceimpl<T> AsMultiTargetsMut for T where
T: AsTargetsMut<Ix = Dim<[usize; 2]>>,
impl<T> AsMultiTargetsMut for T where
T: AsTargetsMut<Ix = Dim<[usize; 2]>>,
fn as_multi_targets_mut(&mut self) -> ArrayViewMut2<'_, Self::Elem>
sourceimpl<T> AsSingleTargets for T where
T: AsTargets<Ix = Dim<[usize; 1]>>,
impl<T> AsSingleTargets for T where
T: AsTargets<Ix = Dim<[usize; 1]>>,
fn as_single_targets(&self) -> ArrayView1<'_, Self::Elem>
sourceimpl<T> AsSingleTargetsMut for T where
T: AsTargetsMut<Ix = Dim<[usize; 1]>>,
impl<T> AsSingleTargetsMut for T where
T: AsTargetsMut<Ix = Dim<[usize; 1]>>,
fn as_single_targets_mut(&mut self) -> ArrayViewMut1<'_, Self::Elem>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more