[−][src]Struct rv::data::CategoricalSuffStat
Categorical distribution sufficient statistic.
Store the number of observations and the count of observations of each instance.
Methods
impl CategoricalSuffStat
[src]
pub fn new(k: usize) -> Self
[src]
pub fn n(&self) -> usize
[src]
Get the total number of trials
Example
let mut stat = CategoricalSuffStat::new(3); stat.observe(&0_u8); stat.observe(&1_u8); stat.observe(&1_u8); assert_eq!(stat.n(), 3);
pub fn counts(&self) -> &Vec<f64>
[src]
Get the number of occurrences of each class, counts
Example
let mut stat = CategoricalSuffStat::new(3); stat.observe(&0_u8); stat.observe(&1_u8); stat.observe(&1_u8); assert_eq!(*stat.counts(), vec![1.0, 2.0, 0.0]);
Trait Implementations
impl<X: CategoricalDatum> SuffStat<X> for CategoricalSuffStat
[src]
fn n(&self) -> usize
[src]
fn observe(&mut self, x: &X)
[src]
fn forget(&mut self, x: &X)
[src]
fn observe_many(&mut self, xs: &[X])
[src]
fn forget_many(&mut self, xs: &[X])
[src]
impl<'a, X> Into<DataOrSuffStat<'a, X, Categorical>> for &'a CategoricalSuffStat where
X: CategoricalDatum,
[src]
X: CategoricalDatum,
fn into(self) -> DataOrSuffStat<'a, X, Categorical>
[src]
impl Clone for CategoricalSuffStat
[src]
fn clone(&self) -> CategoricalSuffStat
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<CategoricalSuffStat> for CategoricalSuffStat
[src]
fn eq(&self, other: &CategoricalSuffStat) -> bool
[src]
fn ne(&self, other: &CategoricalSuffStat) -> bool
[src]
impl PartialOrd<CategoricalSuffStat> for CategoricalSuffStat
[src]
fn partial_cmp(&self, other: &CategoricalSuffStat) -> Option<Ordering>
[src]
fn lt(&self, other: &CategoricalSuffStat) -> bool
[src]
fn le(&self, other: &CategoricalSuffStat) -> bool
[src]
fn gt(&self, other: &CategoricalSuffStat) -> bool
[src]
fn ge(&self, other: &CategoricalSuffStat) -> bool
[src]
impl Debug for CategoricalSuffStat
[src]
impl StructuralPartialEq for CategoricalSuffStat
[src]
Auto Trait Implementations
impl Send for CategoricalSuffStat
impl Sync for CategoricalSuffStat
impl Unpin for CategoricalSuffStat
impl UnwindSafe for CategoricalSuffStat
impl RefUnwindSafe for CategoricalSuffStat
Blanket Implementations
impl<S, X> SuffStat<X> for S where
S: DerefMut,
<S as Deref>::Target: SuffStat<X>,
[src]
S: DerefMut,
<S as Deref>::Target: SuffStat<X>,
fn n(&Self) -> usize
[src]
fn observe(&mut Self, &X)
[src]
fn forget(&mut Self, &X)
[src]
fn observe_many(&mut Self, &[X])
[src]
fn forget_many(&mut Self, &[X])
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,