lore_sa.encoder_decoder.OneHotEnc
- class lore_sa.encoder_decoder.OneHotEnc(descriptor: dict)[source]
It provides an interface to access One Hot enconding (https://en.wikipedia.org/wiki/One-hot) functions. It relies on OneHotEncoder class from sklearn
Methods
__init__
(descriptor)add_encoded_features
(encoded_features)clean_encoded_descriptor_by_old
(old_field)decode
(x)Decode the array staring from the original descriptor
decode_target_class
(x)encode
(x)It applies the encoder to the input features
Provides a dictionary with the new encoded features name and the new index :return:
update_encoded_index
(current_field, size)- decode(x: array)[source]
Decode the array staring from the original descriptor
- Parameters
x ([Numpy array]) – Array to decode
- Return [Numpy array]
Decoded array