hosa.helpers.functions.create_overlapping
- hosa.helpers.functions.create_overlapping(x, y, model, n_overlapping_epochs=0, overlapping_type=None, n_stride=1, n_timesteps=None)[source]
Depending on the model chosen, prepare the data with segmented windows according to the number of epochs and overlapping type.
- Parameters
x (numpy.ndarray) – Input data.
y (numpy.ndarray or None) – Target values (class labels in classification, real numbers in regression). If None, the parameter will be ingored.
model (object) – Class of the object to be optimized. Available options are:
RNNClassification,RNNRegression,CNNClassificationandCNNRegression.n_overlapping_epochs (int) – Number of epochs to be overlapped (in other words, the overlap duration).
overlapping_type (str or None) – Type of overlapping to perform on the data. Available
are (options) – central, where the target value corresponds to the central epoch of the overlapping window; left, where the target value corresponds to the rightmost epoch of the overlapping window and right, where the target value corresponds to the leftmost epoch of the overlapping window. When n_overlapping_epochs=0, this parameter is ignored.
n_stride (int) – Number of strides to apply to the data.
n_timesteps (int) – Number of timesteps to apply to the data for recurrent models, in other words, the number of lagged observations to be used in the model. Only used when `model=RNNClassification` or `model=RNNRegression`.
- Returns
tuple –
- Returns a tuple with the input data (x) and target values (y)—or None if
y=None—, both in segmented window view.