Implement purged_walk_forward_splits(n_samples, n_splits, embargo).
Return a list of n_splits tuples (train_idx, test_idx), each a 1-D NumPy integer array, built as follows:
fold_size = n_samples // (n_splits + 1).k = 1 .. n_splits, the test block is [k * fold_size, (k + 1) * fold_size), except the last fold, whose test block runs to n_samples.[0, k * fold_size - embargo).So training always lies in the past, and the embargo samples immediately preceding the test block are discarded from training.
purged_walk_forward_splits(20, 3, 2)[0]
# (array([0, 1, 2]), array([5, 6, 7, 8, 9]))
np.arange(a, b) builds each index block.n_samples is not divisible by n_splits + 1.