pub struct LeaveOneOut;Expand description
Leave-one-out cross-validation (LOO).
Each sample serves as the sole test point exactly once, with every other
sample forming the training set — equivalent to KFold with
n_splits == n_samples. Included for API completeness.
Cost warning: LOO fits the model n_samples times. On anything but small
datasets this is very expensive; prefer a modest KFold (5 or 10) unless you
specifically need LOO’s near-unbiased (but high-variance) estimate.
use model_selection_rs::splitters::{CvSplitter, LeaveOneOut};
let loo = LeaveOneOut;
let splits = loo.split(4).unwrap();
assert_eq!(splits.len(), 4);
assert_eq!(splits[0], (vec![1, 2, 3], vec![0]));Trait Implementations§
Source§impl Clone for LeaveOneOut
impl Clone for LeaveOneOut
Source§fn clone(&self) -> LeaveOneOut
fn clone(&self) -> LeaveOneOut
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 moreimpl Copy for LeaveOneOut
Source§impl CvSplitter for LeaveOneOut
impl CvSplitter for LeaveOneOut
Source§impl Debug for LeaveOneOut
impl Debug for LeaveOneOut
Source§impl Default for LeaveOneOut
impl Default for LeaveOneOut
Source§fn default() -> LeaveOneOut
fn default() -> LeaveOneOut
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LeaveOneOut
impl RefUnwindSafe for LeaveOneOut
impl Send for LeaveOneOut
impl Sync for LeaveOneOut
impl Unpin for LeaveOneOut
impl UnsafeUnpin for LeaveOneOut
impl UnwindSafe for LeaveOneOut
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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