Preprocessing 0.2.0 foldsplit - CyrilB1531/lodestar GitHub Wiki

Lodestar.Preprocessing 0.2.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Home › Splitting

FoldSplit

One fold of a cross-validation split: which rows train, and which are held out.

public sealed class FoldSplit

Properties — TrainIndices is the rows this fold fits on and TestIndices the rows it holds out, both ascending and both IReadOnlyList<int>. Together they are every row, each exactly once.

Example — the two sides of one fold.

using Lodestar.Preprocessing;

FoldSplit fold = Splitters.KFold(sampleCount: 10, foldCount: 5)[2];

string held = string.Join(",", fold.TestIndices);   // => 4,5
int fitted = fold.TrainIndices.Count;               // => 8

Remarks — indices rather than rows. A splitter that copied the data would decide the caller's layout for them, and the indices are what a fit and a score both take: scaler.Fit(Gather(samples, fold.TrainIndices), featureCount) is the caller's own gather, over whatever container the data actually lives in.

There is no constructor: a FoldSplit comes from Splitters.

Applies to — net10.0, netstandard2.0.

See also — Splitters.KFold, Splitters.StratifiedKFold, TrainTestSplit.

⚠️ **GitHub.com Fallback** ⚠️