lore_sa.encoder_decoder.EncDec

class lore_sa.encoder_decoder.EncDec(dataset_descriptor)[source]

Generic class to implement an encoder/decoder

It is implemented by different classes, each of which must implements the functions: enc, dec, enc_fit_transform the idea is that the user sends the complete record and here only the categorical variables are handled

__init__(dataset_descriptor)[source]

Methods

__init__(dataset_descriptor)

decode(x)

decode_target_class(x)

encode(x)

It applies the encoder to the input features

get_encoded_features()

Provides a dictionary with the new encoded features name and the new index :return:

abstract encode(x: array)[source]

It applies the encoder to the input features

Param[Numpy array] x

the Dataset containing the features to be encoded

Param[list] features_to_encode

list of columns of Dataset.df dataframe to be encoded

abstract get_encoded_features()[source]

Provides a dictionary with the new encoded features name and the new index :return: