make_example_3d_numpy

make_example_3d_numpy(n_cases: int = 10, n_channels: int = 1, n_timepoints: int = 12, n_labels: int = 2, min_cases_per_label: int = 1, regression_target: bool = False, random_state: int | None = None, return_y: bool = True) ndarray | tuple[ndarray, ndarray][source]

Randomly generate 3D numpy X and numpy y data for testing.

Generates data in ‘numpy3D’ 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.

n_timepointsint

The number of features/series length to generate.

n_labelsint

The number of unique labels to generate.

min_cases_per_labelint

The minimum number of samples per unique label.

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:
Xnp.ndarray

Randomly generated 3D data.

ynp.ndarray

Randomly generated labels if return_y is True.

Examples

>>> from aeon.testing.data_generation import make_example_3d_numpy
>>> from aeon.utils.validation.collection import get_type
>>> data, labels = make_example_3d_numpy(
...     n_cases=2,
...     n_channels=2,
...     n_timepoints=6,
...     n_labels=2,
...     random_state=0,
... )
>>> print(data)
[[[0.         1.43037873 1.20552675 1.08976637 0.8473096  1.29178823]
  [0.87517442 1.783546   1.92732552 0.76688304 1.58345008 1.05778984]]

 [[2.         3.70238655 0.28414423 0.3485172  0.08087359 3.33047938]
  [3.112627   3.48004859 3.91447337 3.19663426 1.84591745 3.12211671]]]
>>> print(labels)
[0 1]
>>> get_type(data)
'numpy3D'