deepof.utils.rupture_per_experiment
- deepof.utils.rupture_per_experiment(table_dict: deepof_table_dict, to_rupture: ndarray, rupture_indices: list, automatic_changepoints: str, window_size: int, window_step: int, precomputed_breaks: dict | None = None) ndarray
Apply the rupture method independently to each experiment, and concatenate into a single dataset at the end.
Returns a dataset and the rupture indices, adapted to be used in a concatenated version of the labels.
- Parameters:
table_dict (deepof.data.table_dict) – table_dict with all experiments.
to_rupture (np.ndarray) – Array with dataset to rupture.
rupture_indices (list) – Indices of tables to rupture. Useful to select training and test sets.
automatic_changepoints (str) – Rupture method to apply. If false, a sliding window of window_length * window_size is obtained. If one of “l1”, “l2” or “rbf”, different automatic change point detection algorithms are applied on each independent experiment.
window_size (int) – If automatic_changepoints is False, specifies the length of the sliding window. If not, it determines the minimum size of the obtained time series breaks.
window_step (int) – If automatic_changepoints is False, specifies the stride of the sliding window. If not, it determines the minimum step size of the obtained time series breaks.
precomputed_breaks (dict) – If provided, changepoint detection is prevented, and provided breaks are used instead.
- Returns:
Dataset with all ruptures concatenated across the first axis. rupture_indices (list): Indices of ruptures.
- Return type:
ruptured_dataset (np.ndarray)