facet.validation.StratifiedBootstrapCV#

class facet.validation.StratifiedBootstrapCV(n_splits=1000, random_state=None)[source]#

Stratified bootstrapping cross-validation.

Generates CV splits by random sampling with replacement. The resulting training set is the same size as the total sample; the test set consists of all samples not included in the training set.

Sampling is stratified based on a series or 1d array of group labels in the target vector. Bootstrapping is carried out separately for each group.

Bases

BaseBootstrapCV

Metaclasses

ABCMeta

Parameters
  • n_splits (int) – number of splits to generate (default: 1000)

  • random_state (Union[int, RandomState, None]) – random state to initialise the random generator with (optional)

Method summary

get_n_splits

Return the number of splits generated by this cross-validator.

split

Generate indices to split data into training and test set.

Definitions

get_n_splits(X=None, y=None, groups=None)#

Return the number of splits generated by this cross-validator.

Parameters
Return type

int

Returns

the number of splits

split(X, y=None, groups=None)#

Generate indices to split data into training and test set.

Parameters
Return type

Generator[Tuple[ndarray[Any, dtype[int64]], ndarray[Any, dtype[int64]]], None, None]

Returns

a generator yielding (train, test) tuples where train and test are numpy arrays with train and test indices, respectively