make_example_3d_numpy_list¶
- make_example_3d_numpy_list(n_cases: int = 10, n_channels: int = 1, min_n_timepoints: int = 8, max_n_timepoints: int = 12, n_labels: int = 2, regression_target: bool = False, random_state: int | None = None, return_y: bool = True) list[ndarray] | tuple[list[ndarray], ndarray][source]¶
Randomly generate 3D list of numpy X and numpy y for testing.
Generates data in ‘np-list’ format.
Will ensure there is at least one sample per label if a classification label is being returned (regression_target=False).
- Parameters:
- n_casesint
The number of samples to generate.
- n_channelsint
The number of series channels to generate.
- min_n_timepointsint
The minimum number of features/series length to generate for individual series.
- max_n_timepointsint
The maximum number of features/series length to generate for individual series.
- n_labelsint
The number of unique labels to generate.
- regression_targetbool
If True, the target will be a scalar float, otherwise an int.
- random_stateint or None
Seed for random number generation.
- return_ybool, default = True
Return the y target variable.
- Returns:
- Xlist of np.ndarray
Randomly generated potentially unequal length 3D data.
- ynp.ndarray
Randomly generated labels if return_y is True.
Examples
>>> from aeon.testing.data_generation import make_example_3d_numpy_list >>> from aeon.utils.validation.collection import get_type >>> data, labels = make_example_3d_numpy_list( ... n_cases=2, ... n_channels=2, ... min_n_timepoints=4, ... max_n_timepoints=6, ... n_labels=2, ... random_state=0, ... ) >>> print(data) [array([[0. , 1.6885315 , 1.71589124, 1.69450348], [1.24712739, 0.76876341, 0.59506921, 0.11342595]]), array([[2. , 3.16690015, 2.11557968, 2.27217824], [3.70238655, 0.28414423, 0.3485172 , 0.08087359]])] >>> print(labels) [0 1] >>> get_type(data) 'np-list'