opfython.stream.splitter¶
Data splitting utilities.
- opfython.stream.splitter.logger¶
- opfython.stream.splitter.merge(X_1: numpy.array, X_2: numpy.array, Y_1: numpy.array, Y_2: numpy.array)¶
Merge two sets into a new set.
- Parameters
X_1 – First array of features.
X_2 – Second array of features.
Y_1 – First array of labels.
Y_2 – Second array of labels.
- Returns
): A new merged set that was created from X_1, X_2, Y_1 and Y_2.
- Return type
(Tuple[np.array, np.array]
- opfython.stream.splitter.split(X: numpy.array, Y: numpy.array, percentage: Optional[float] = 0.5, random_state: Optional[int] = 1)¶
Splits data into two new sets.
- Parameters
X – Array of features.
Y – Array of labels.
percentage – Percentage of the data that should be in first set.
random_state – An integer that fixes the random seed.
- Returns
Two new sets that were created from X and Y.
- Return type
(Tuple[np.array, np.array, np.array, np.array])
- opfython.stream.splitter.split_with_index(X: numpy.array, Y: numpy.array, percentage: Optional[float] = 0.5, random_state: Optional[int] = 1)¶
Splits data into two new sets.
- Parameters
X – Array of features.
Y – Array of labels.
percentage – Percentage of the data that should be in first set.
random_state – An integer that fixes the random seed.
- Returns
Two new sets that were created from X and Y, along their indexes.
- Return type
(Tuple[np.array, np.array, np.array, np.array, np.array, np.array])