tonic.functional.drop_by_time_numpy#
- tonic.functional.drop_by_time_numpy(events: ndarray, duration_ratio: Union[float, Tuple[float]] = 0.2)[source]#
Drops events in a certain time interval with a length proportional to a specified ratio of the original length.
- Parameters:
events (np.ndarray) – ndarray of shape [num_events, num_event_channels]
duration_ratio (Union[float, Tuple[float]], optional) – the length of the dropped time interval, expressed in a ratio of the original sequence duration. - If a float, the value is used to calculate the interval length - If a tuple of 2 floats, the ratio is randomly chosen in [min, max). Defaults to 0.2.
- Returns:
augmented events that were not dropped (i.e., the events that are not in the time interval).
- Return type:
np.ndarray