pub struct RepeatedStratifiedKFold { /* private fields */ }Expand description
Repeated Stratified K-Fold cross-validator
Repeats Stratified K-Fold n times with different randomization in each repetition. This provides more robust estimates while maintaining the class distribution in each fold. This is particularly useful for imbalanced datasets where you want both stratification and robust estimates.
§Examples
use sklears_model_selection::{RepeatedStratifiedKFold, CrossValidator};
use scirs2_core::ndarray::array;
let cv = RepeatedStratifiedKFold::new(2, 2) // 2-fold repeated 2 times
.random_state(42);
let y = array![0, 0, 1, 1, 2, 2];
let splits = cv.split(6, Some(&y));
assert_eq!(splits.len(), 4); // 2 * 2 = 4 splitsImplementations§
Source§impl RepeatedStratifiedKFold
impl RepeatedStratifiedKFold
Sourcepub fn random_state(self, seed: u64) -> Self
pub fn random_state(self, seed: u64) -> Self
Sourcepub fn n_splits_per_repeat(&self) -> usize
pub fn n_splits_per_repeat(&self) -> usize
Get the number of splits per repetition
Trait Implementations§
Source§impl Clone for RepeatedStratifiedKFold
impl Clone for RepeatedStratifiedKFold
Source§fn clone(&self) -> RepeatedStratifiedKFold
fn clone(&self) -> RepeatedStratifiedKFold
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 moreAuto Trait Implementations§
impl Freeze for RepeatedStratifiedKFold
impl RefUnwindSafe for RepeatedStratifiedKFold
impl Send for RepeatedStratifiedKFold
impl Sync for RepeatedStratifiedKFold
impl Unpin for RepeatedStratifiedKFold
impl UnwindSafe for RepeatedStratifiedKFold
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<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