CatIntersectstions

class lightautoml.transformers.categorical.CatIntersectstions(subs=None, random_state=42, intersections=None, max_depth=2)[source]

Bases: lightautoml.transformers.categorical.LabelEncoder

Build label encoded intertsections of categorical variables.

__init__(subs=None, random_state=42, intersections=None, max_depth=2)[source]

Create label encoded intersection columns for categories.

Parameters
  • intersections (Optional[Sequence[Sequence[str]]]) – Columns to create intersections. Default is None - all.

  • max_depth (int) – Max intersection depth.

fit(dataset)[source]

Create label encoded intersections and save mapping.

Parameters

dataset (Union[NumpyDataset, PandasDataset]) – Pandas or Numpy dataset of categorical features.

Returns

self.

transform(dataset)[source]

Create label encoded intersections and apply mapping

Parameters

dataset (Union[NumpyDataset, PandasDataset]) – Pandas or Numpy dataset of categorical features

Returns:

Return type

NumpyDataset