resample_data_indices

resample_data_indices(y_train, y_test, random_state=None)[source]

Return data resample indices without replacement using a random state.

Reproducible resampling. Combines train and test, randomly resamples, then returns the new position for both the train and test set. Uses indices for a combined train and test set, with test indices appearing after train indices.

Parameters:
y_trainnp.ndarray

Train data labels.

y_testnp.ndarray

Test data labels.

random_stateint, RandomState instance or None, default=None

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Returns:
train_indicesnp.ndarray

The index of cases to use in the train set from the combined train and test data.

test_indicesnp.ndarray

The index of cases to use in the test set from the combined train and test data.