pub struct KFold {
pub k: usize,
pub shuffle: Option<u64>,
}Expand description
The plain cut: the samples in k parts, each one held out while the rest
train.
LeaveOneOut is this with k = n, and a holdout of one part in k is its
fold 0. Neither earns a scheme of its own — a scheme that is a parameter is
a name you have to remember for nothing.
use somatize_study::{KFold, Samples};
let folds = KFold { k: 5, shuffle: Some(0) }.folds(&Samples::of(100))?;
assert_eq!(folds.len(), 5);Fields§
§k: usizeHow many folds.
shuffle: Option<u64>The seed, or None for the order they came in.
The seed both switches shuffling on and makes it repeatable, so “shuffled but not reproducible” is a state that cannot be written down.
Implementations§
Trait Implementations§
impl Eq for KFold
impl StructuralPartialEq for KFold
Auto Trait Implementations§
impl Freeze for KFold
impl RefUnwindSafe for KFold
impl Send for KFold
impl Sync for KFold
impl Unpin for KFold
impl UnsafeUnpin for KFold
impl UnwindSafe for KFold
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