paddlets.models.utils

check_tsdataset(tsdataset: TSDataset)[源代码]

保证入模数据的鲁棒性(特征顺序的一致性), 同时, 检查数据类型的兼容性, 如果不兼容, 处理逻辑如下.

整形: 统一转换为np.int64.

浮点型: 统一转换为np.float32.

缺失值: 警告.

其他: 非法.

参数

tsdataset (TSDataset) – 待检查的数据.

to_tsdataset(func) Callable[[...], TSDataset][源代码]

装饰器, 基于np.ndarray类型数据生成TSDataset类型数据(兼容ML模型和DL模型).

参数

func (Callable[..., np.ndarray]) – 核心函数.

返回

被装饰的函数.

返回类型

Callable[…, TSDataset]