Encoders

The Encoders transform the categorical columns into numerical columns.

Note

The Encoders transform the data inplace. The output of an encoder is then a numerical dataframe or array. Before calling an encoder, all the transformations on categorical columns should be done and the datetime columns should be dropped.

BaseEncoder

_BaseEncoder

Base encoder transformer class.

Unsupervised Encoders

OrdinalEncoder

Encode the categorical columns as integer columns.

FrequencyEncoder

Encode the categorical columns as integer columns based on the category count.

OneHotEncoder

Encode the categorical columns as one-hot numeric columns.

BinnedColumnsEncoder

Encode the categorical variables after running a Gators Binning transformer.

Supervised Encoders

WOEEncoder

Encode all categorical variables using the weight of evidence technique.

TargetEncoder

Encode the categorical variables using the target encoding technique.

Note

WOEEncoder is only valid for binary classification problems, TargetEncoder works for binary and regression problems. In the case of a multiclass classification problem, it is recommended to use a one-versus-all approach in order to use the supervised encoders.