Split a dataset into shuffled mini-batches. Shuffle the row indices once with np.random.default_rng(seed).shuffle, then cut the shuffled order into consecutive chunks of at most batch_size; the last batch may be smaller.
Implement solve(X, y, batch_size, seed=0).
Returns. Return a list of (X_batch, y_batch) tuples, each a pair of Python lists, covering every example exactly once.
Example 1
Input:
solve([[0], [1], [2], [3], [4]], [0, 1, 2, 3, 4], 2, seed=0)
Output:
[([[2], [4]], [2, 4]), ([[3], [0]], [3, 0]), ([[1]], [1])]
Example 2
Input:
solve([[1], [2], [3], [4]], [10, 20, 30, 40], 4, seed=1)
Output:
[([[1], [2], [3], [4]], [10, 20, 30, 40])]
No results yet
Run your code to check it against the examples, or submit to run every test.