glassbox.orchestrator.splitters¶
Cross-validation generators (KFoldSplitter, StratifiedKFoldSplitter).
KFoldSplitter
¶
Bases: BaseSplitter
K-fold cross-validation splitter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_splits
|
int
|
Number of folds. |
5
|
shuffle
|
bool
|
Whether to shuffle data before splitting. |
False
|
Source code in glassbox/orchestrator/base_splitter.py
split
¶
Generate train/test splits for K-fold cross-validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Data array of shape (n_samples, n_features). |
required |
y
|
ndarray
|
Target values of shape (n_samples,). |
required |
Returns:
| Type | Description |
|---|---|
Generator[Tuple[ndarray, ndarray], None, None]
|
Generator yielding training and validation index tuples. |
Source code in glassbox/orchestrator/splitters.py
StratifiedKFoldSplitter
¶
Bases: BaseSplitter
Stratified K-fold cross-validation splitter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_splits
|
int
|
Number of folds. |
5
|
shuffle
|
bool
|
Whether to shuffle data before splitting. |
False
|
Source code in glassbox/orchestrator/base_splitter.py
split
¶
Generate stratified train/test splits for K-fold cross-validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
X
|
ndarray
|
Data array of shape (n_samples, n_features). |
required |
y
|
ndarray
|
Target values of shape (n_samples,). |
required |
Returns:
| Type | Description |
|---|---|
Generator[Tuple[ndarray, ndarray], None, None]
|
Generator yielding training and validation index tuples. |