ctf4science.data_module.load_dataset#
- ctf4science.data_module.load_dataset(dataset_name: str, pair_id: int, transpose=False) tuple[list, ndarray | None]#
Load train and initialization data for a given dataset and pair ID.
Training matrices are loaded from the dataset
train/directory according to the pair config; optional initialization matrix is loaded if present.- Parameters:
- dataset_namestr
Name of the dataset (e.g.
'ODE_Lorenz','PDE_KS').- pair_idint
ID of the train-test pair.
- transposebool, optional
If True, transpose each loaded matrix. Default is False.
- Returns:
- train_datalist of ndarray
List of training data arrays (one per
trainentry in the pair).- init_datandarray or None
Initialization data if the pair defines it, otherwise None.
- Raises:
- ValueError
If pair_id does not exist, has no training matrices, or a data file does not contain exactly one main variable.
- FileNotFoundError
If any train or initialization data file is not found.