pub struct SampleCount(/* private fields */);Expand description
Type-safe sample count
Implementations§
Source§impl SampleCount
impl SampleCount
Sourcepub fn new(count: usize) -> Result<SampleCount, SklearsError>
pub fn new(count: usize) -> Result<SampleCount, SklearsError>
Create a new sample count, must be positive
pub fn as_f64(self) -> f64
Sourcepub fn percentage_of(self, total: SampleCount) -> Result<f64, SklearsError>
pub fn percentage_of(self, total: SampleCount) -> Result<f64, SklearsError>
Calculate percentage of another sample count
Sourcepub fn is_valid_split_with(
self,
other: SampleCount,
min_samples_per_split: usize,
) -> bool
pub fn is_valid_split_with( self, other: SampleCount, min_samples_per_split: usize, ) -> bool
Check if this is a valid train/test split ratio
Trait Implementations§
Source§impl Add for SampleCount
impl Add for SampleCount
Source§type Output = SampleCount
type Output = SampleCount
The resulting type after applying the
+ operator.Source§fn add(self, other: SampleCount) -> <SampleCount as Add>::Output
fn add(self, other: SampleCount) -> <SampleCount as Add>::Output
Performs the
+ operation. Read moreSource§impl Clone for SampleCount
impl Clone for SampleCount
Source§fn clone(&self) -> SampleCount
fn clone(&self) -> SampleCount
Returns a duplicate 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 Debug for SampleCount
impl Debug for SampleCount
Source§impl Display for SampleCount
impl Display for SampleCount
Source§impl Hash for SampleCount
impl Hash for SampleCount
Source§impl Ord for SampleCount
impl Ord for SampleCount
Source§fn cmp(&self, other: &SampleCount) -> Ordering
fn cmp(&self, other: &SampleCount) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SampleCount
impl PartialEq for SampleCount
Source§impl PartialOrd for SampleCount
impl PartialOrd for SampleCount
Source§impl Sub for SampleCount
impl Sub for SampleCount
Source§type Output = Result<SampleCount, SklearsError>
type Output = Result<SampleCount, SklearsError>
The resulting type after applying the
- operator.Source§fn sub(self, other: SampleCount) -> <SampleCount as Sub>::Output
fn sub(self, other: SampleCount) -> <SampleCount as Sub>::Output
Performs the
- operation. Read moreimpl Copy for SampleCount
impl Eq for SampleCount
impl StructuralPartialEq for SampleCount
Auto Trait Implementations§
impl Freeze for SampleCount
impl RefUnwindSafe for SampleCount
impl Send for SampleCount
impl Sync for SampleCount
impl Unpin for SampleCount
impl UnwindSafe for SampleCount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more