pub struct Samples { /* private fields */ }Expand description
How many samples there are, and what is known about each. Built up, because most cuts need only the count:
use somatize_study::Samples;
let plain = Samples::of(100);
let labelled = Samples::of(6).by_class(vec![0, 0, 1, 1, 0, 1])?;
let both = Samples::of(6)
.by_class(vec![0, 0, 1, 1, 0, 1])?
.in_groups(vec![7, 7, 8, 8, 9, 9])?;Implementations§
Source§impl Samples
impl Samples
Sourcepub fn by_class(self, strata: Vec<u32>) -> Result<Self, SamplesError>
pub fn by_class(self, strata: Vec<u32>) -> Result<Self, SamplesError>
The class of each sample, in the same order. What
Stratified honours.
The values are opaque: they are compared, never ordered or counted on to
start at zero. 0/1 and 31337/4 cut the same.
Trait Implementations§
impl Eq for Samples
impl StructuralPartialEq for Samples
Auto Trait Implementations§
impl Freeze for Samples
impl RefUnwindSafe for Samples
impl Send for Samples
impl Sync for Samples
impl Unpin for Samples
impl UnsafeUnpin for Samples
impl UnwindSafe for Samples
Blanket Implementations§
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