StratifiedBootstrapSplitter<T>
Models & Types ยท AiDotNet.Preprocessing.DataPreparation.Splitting.Bootstrap
Stratified bootstrap sampling that preserves class distribution.
Inheritance: DataSplitterBase<T> โ StratifiedBootstrapSplitter<T>
For Beginners
This combines bootstrap sampling with stratification. Within each class, we sample with replacement, ensuring the bootstrap sample maintains approximately the same class proportions as the original data.
How It Works
When to Use:
- Bootstrap with imbalanced classes
- When you need class proportions preserved in each bootstrap sample
Constructors
| Constructor | Summary |
|---|---|
StratifiedBootstrapSplitter(int nIterations, int randomSeed) |
Creates a new stratified bootstrap splitter. |
Properties
| Property | Summary |
|---|---|
bool RequiresLabels { 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) |