paddlets.transform.ordinal
- class Ordinal(cols: Union[str, List], dtype: dtype = dtype('float64'), categories: Union[str, List] = 'auto', unknown_value: Union[None, int] = None, handle_unknown: str = 'error', drop: bool = False)[source]
Bases:
BaseTransformEncode categorical features as an integer array.
- Parameters
cols (str|List) – Name of columns to Encode
handle_unknown (str) – {‘error’, ‘use_encoded_value’}, default=’error’
drop (bool) – Whether to delete the original column, default=False.
dtype (object) – Number type, default=float.
unknown_value (str) – int or np.nan, default=None.
categorie (str|List) – ‘auto’ or a list of array-like, default=’auto’,if categorie is ‘auto’, it determine categories automatically from the training data. if categorie is list, categories[i] holds the categories expected in the ith column. The passed categories should not mix strings and numeric values, and should be sorted in case of numeric values.
- Returns
None
- fit(dataset: TSDataset)[source]
Fit the OrdinalEncoder to dataset.
- Parameters
dataset (TSDataset) – Dataset to be fitted.
- Returns
Ordinal