pub struct RandomIidSplit {
pub rows: RowSplit,
pub seed: u64,
pub test_frac: OrderedFrac,
}Expand description
Random IID train/test split (seeded; metadata only).
Fields§
§rows: RowSplitResulting row partition.
seed: u64Seed used to shuffle.
test_frac: OrderedFracRequested test fraction.
Implementations§
Source§impl RandomIidSplit
impl RandomIidSplit
Sourcepub fn try_new(n: usize, test_frac: f64, seed: u64) -> Result<Self, DataError>
pub fn try_new(n: usize, test_frac: f64, seed: u64) -> Result<Self, DataError>
Shuffle 0..n and take the last test_frac as test.
For temporal / panel / event data, callers must pass
TemporalRandomPolicy::Allow via ensure_random_allowed_on_temporal
before constructing this split.
§Errors
Empty n, invalid fraction, or empty train/test after rounding.
Trait Implementations§
Source§impl Clone for RandomIidSplit
impl Clone for RandomIidSplit
Source§fn clone(&self) -> RandomIidSplit
fn clone(&self) -> RandomIidSplit
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RandomIidSplit
impl Debug for RandomIidSplit
impl Eq for RandomIidSplit
Source§impl PartialEq for RandomIidSplit
impl PartialEq for RandomIidSplit
impl StructuralPartialEq for RandomIidSplit
Auto Trait Implementations§
impl Freeze for RandomIidSplit
impl RefUnwindSafe for RandomIidSplit
impl Send for RandomIidSplit
impl Sync for RandomIidSplit
impl Unpin for RandomIidSplit
impl UnsafeUnpin for RandomIidSplit
impl UnwindSafe for RandomIidSplit
Blanket Implementations§
impl<T> Allocation for T
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