LeavePOutSplitter<T>

Models & Types · AiDotNet.Preprocessing.DataPreparation.Splitting.CrossValidation

Leave-P-Out cross-validation where all combinations of p samples form the test sets.

Inheritance: DataSplitterBase<T> → LeavePOutSplitter<T>

For Beginners

Leave-P-Out (LPO) tests all possible combinations of p samples. This is an exhaustive evaluation but can be extremely expensive.

How It Works

Number of Splits: The number of splits is C(n, p) = n! / (p! × (n-p)!)

  • n=10, p=2: 45 splits
  • n=20, p=2: 190 splits
  • n=10, p=3: 120 splits

Warning: The number of combinations grows very quickly! LPO is only practical for very small datasets and small p values.

When to Use:

  • Tiny datasets (<30 samples)
  • When you need exhaustive evaluation
  • Statistical research

Constructors

Constructor Summary
LeavePOutSplitter(int p) Creates a new Leave-P-Out cross-validation splitter.

Properties

Property Summary
int NumSplits { get; }
string Description { get; }

Methods

Method Summary
DataSplitResult<T> Split(Matrix<T> X, Vector<T> y)
IEnumerable<DataSplitResult<T>> GetSplits(Matrix<T> X, Vector<T> y)