Skip to content

encoders

sorix.preprocessing.encoders

OneHotEncoder

OneHotEncoder()
Source code in sorix/preprocessing/encoders.py
5
6
7
8
9
def __init__(self):
    self.n_features = 0
    self.features = {

    }

state_dict

state_dict()

Returns a dictionary with the state of the encoder.

Source code in sorix/preprocessing/encoders.py
def state_dict(self):
    """Returns a dictionary with the state of the encoder."""
    return {k: v for k, v in self.__dict__.items() if not k.startswith('_')}

load_state_dict

load_state_dict(state_dict)

Loads the state of the encoder from a dictionary.

Source code in sorix/preprocessing/encoders.py
def load_state_dict(self, state_dict):
    """Loads the state of the encoder from a dictionary."""
    for k, v in state_dict.items():
        setattr(self, k, v)
    return self