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(scenario: str = 'forecasting') Callable[[...], Callable[[...], TSDataset]][source]

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

Parameters

scenario (str) – The task type. [“forecasting”, “anomaly_label”, “anomaly_score”] is optional.

Returns

Wrapped core function.

Return type

Callable[…, Callable[…, TSDataset]]

build_network_input_spec(meta_data: Dict[str, str]) List[type][source]

build paddle network input_spec params for save by meta_data

Parameters

meta_data (Dict[str, str]) – The meta data in model.

Returns

input_spec param for paddle api paddle.jit.to_static

Return type

List[type]