split_numpy_arrays

tfsnippet.utils.split_numpy_arrays(arrays, portion=None, size=None, shuffle=True, random_state=None)

Split numpy arrays into two halves, by portion or by size.

Parameters:
  • arrays (Iterable[np.ndarray]) – Numpy arrays to be splitted.
  • portion (float) – Portion of the second half. Ignored if size is specified.
  • size (int) – Size of the second half.
  • shuffle (bool) – Whether or not to shuffle before splitting?
  • random_state (RandomState) – Optional numpy RandomState for shuffling data. (default None, construct a new RandomState).
Returns:

Splitted two halves of arrays.

Return type:

(tuple[np.ndarray], tuple[np.ndarray])