Trait BaseKFold

Source
pub trait BaseKFold {
    type Output: Iterator<Item = (Vec<usize>, Vec<usize>)>;

    // Required methods
    fn split<T: Number, X: Array2<T>>(&self, x: &X) -> Self::Output;
    fn n_splits(&self) -> usize;
}
Expand description

An interface for the K-Folds cross-validator

Required Associated Types§

Source

type Output: Iterator<Item = (Vec<usize>, Vec<usize>)>

An iterator over indices that split data into training and test set.

Required Methods§

Source

fn split<T: Number, X: Array2<T>>(&self, x: &X) -> Self::Output

Return a tuple containing the the training set indices for that split and the testing set indices for that split.

Source

fn n_splits(&self) -> usize

Returns the number of splits

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl BaseKFold for KFold

Abstract class for all KFold functionalities