make_example_dataframe_list¶
- make_example_dataframe_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[DataFrame] | tuple[list[DataFrame], ndarray][source]¶
随机生成用于测试的DataFrame X和numpy y列表。
生成‘df-list’格式的数据。
如果返回的是分类标签(regression_target=False),将确保每个标签至少有一个样本。
- Parameters:
- n_casesint
要生成的样本数量。
- n_channelsint
要生成的系列通道数量。
- min_n_timepointsint
为单个系列生成的最小特征数/系列长度。
- max_n_timepointsint
为单个系列生成的最大特征/系列长度。
- n_labelsint
要生成的唯一标签的数量。
- regression_targetbool
如果为True,目标将是一个标量浮点数,否则为整数。
- random_stateint or None
随机数生成的种子。
- return_ybool, default = True
返回目标变量 y。
- Returns:
- Xlist of pd.DataFrame
随机生成的潜在不等长3D数据。
- ynp.ndarray
如果 return_y 为 True,则随机生成标签。
示例
>>> from aeon.testing.data_generation import make_example_dataframe_list >>> from aeon.utils.validation.collection import get_type >>> data, labels = make_example_dataframe_list( ... n_cases=2, ... n_channels=2, ... min_n_timepoints=4, ... max_n_timepoints=6, ... n_labels=2, ... random_state=0, ... ) >>> print(data) [ 0 1 0 0.000000 1.688531 1 1.715891 1.694503 2 1.247127 0.768763 3 0.595069 0.113426, 0 1 0 2.000000 3.166900 1 2.115580 2.272178 2 3.702387 0.284144 3 0.348517 0.080874] >>> print(labels) [0 1] >>> get_type(data) 'df-list'