split_numpy_array

tfsnippet.utils.split_numpy_array(array, portion=None, size=None, shuffle=True)

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

Parameters:
  • array (np.ndarray) – A numpy array 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?
Returns:

Splitted two halves of the array.

Return type:

tuple[np.ndarray]