NestedCVSplitter<T>
Models & Types ยท AiDotNet.Preprocessing.DataPreparation.Splitting.Nested
Nested (Double) Cross-Validation splitter for unbiased model selection and evaluation.
Inheritance: DataSplitterBase<T> โ NestedCVSplitter<T>
For Beginners
Regular cross-validation can give biased results if you use it for both model selection (hyperparameter tuning) AND performance estimation. Nested CV solves this with two levels of cross-validation.
How It Works
How It Works:
- Outer loop: Splits data into train+val and test for final evaluation
- Inner loop: Splits train+val for model selection/hyperparameter tuning
Visual Example (3-outer, 2-inner):
Constructors
| Constructor | Summary |
|---|---|
NestedCVSplitter(int outerFolds, int innerFolds, bool shuffle, int randomSeed) |
Creates a new Nested CV splitter. |
Properties
| Property | Summary |
|---|---|
bool SupportsValidation { get; } |
|
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) |