CategoryRole

class lightautoml.dataset.roles.CategoryRole(dtype=<class 'object'>, encoding_type='auto', unknown=5, force_input=False, label_encoded=False, ordinal=False)[source]

Bases: lightautoml.dataset.roles.ColumnRole

Category role.

__init__(dtype=<class 'object'>, encoding_type='auto', unknown=5, force_input=False, label_encoded=False, ordinal=False)[source]

Create category role with specific dtype and attrs.

Parameters
  • dtype (Union[Callable, str]) – Variable type.

  • encoding_type (str) – Encoding type.

  • unknown (int) – Cut-off freq to process rare categories as unseen.

  • force_input (bool) – Select a feature for training, regardless of the selector results.

Note

Valid encoding_type:

  • ‘auto’ - default processing

  • ‘int’ - encode with int

  • ‘oof’ - out-of-fold target encoding

  • ‘freq’ - frequency encoding

  • ‘ohe’ - one hot encoding