data_split

Functions

data_split(x, y, ratio[, maskname])

Split data into training and validation sets.

Module Contents

data_split.data_split(x, y, ratio, maskname=None)

Split data into training and validation sets.

Randomly split the input data arrays into two sets based on the given ratio.

Parameters:
  • x (numpy.ndarray) – The input features array.

  • y (numpy.ndarray) – The target variables array.

  • ratio (float) – The ratio of data to use for the first split (e.g., 0.8 for 80% training).

  • maskname (str, optional) – If provided, save the split masks to a .npz file with this name.

Returns:

  • x1 (numpy.ndarray) – The first split of input features.

  • y1 (numpy.ndarray) – The first split of target variables.

  • x2 (numpy.ndarray) – The second split of input features.

  • y2 (numpy.ndarray) – The second split of target variables.