paddlets.models.utils

get_target_from_tsdataset(tsdataset: TSDataset)[source]

Just reserve target in tsdataset.

Parameters

tsdataset (TSDataset) – Data to be converted.

check_tsdataset(tsdataset: TSDataset)[source]

Ensure the robustness of input data (consistent feature order), at the same time, check whether the data types are compatible. If not, the processing logic is as follows.

1> Integer: Convert to np.int64.

2> Floating: Convert to np.float32.

3> Missing value: Warning.

4> Other: Illegal.

Parameters

tsdataset (TSDataset) – Data to be checked.

to_tsdataset(func) Callable[[...], TSDataset][source]

A decorator, used for converting ndarray to tsdataset (compatible with both DL and ML).

Parameters

func (Callable[..., np.ndarray]) – Core function.

Returns

Wrapped core function.

Return type

Callable[…, TSDataset]