data_split ========== .. py:module:: data_split Functions --------- .. autoapisummary:: data_split.data_split Module Contents --------------- .. py:function:: 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. :param x: The input features array. :type x: `numpy.ndarray` :param y: The target variables array. :type y: `numpy.ndarray` :param ratio: The ratio of data to use for the first split (e.g., 0.8 for 80% training). :type ratio: `float` :param maskname: If provided, save the split masks to a .npz file with this name. :type maskname: `str`, optional :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.