Ejemplo n.º 1
0
 def set_state(self, state):
     super().set_state(state)
     for key, label_encoder in state['label_encoders'].items():
         self.label_encoders[key] = encoder.deserialize(label_encoder)
     for key, label_encoder_state in state['label_encoders_state'].items():
         self.label_encoders[key].set_state(label_encoder_state)
     self.column_names = state['column_names']
     self.column_types = state['column_types']
     self.num_columns = state['num_columns']
     self.shape = state['shape']
     self.num_rows = state['num_rows']
     self.categorical_col = state['categorical_col']
     self.numerical_col = state['numerical_col']
     self.value_counters = utils.to_type_key(state['value_counters'], int)
     self.categorical_categorical = utils.to_type_key(
         state['categorical_categorical'], ast.literal_eval)
     self.numerical_categorical = utils.to_type_key(
         state['numerical_categorical'], ast.literal_eval)
     self.count_frequency = utils.to_type_key(state['count_frequency'], int)
     self.high_level1_col = state['high_level1_col']
     self.high_level2_col = state['high_level2_col']
     self.high_level_cat_cat = utils.to_type_key(
         state['high_level_cat_cat'], ast.literal_eval)
     self.high_level_num_cat = utils.to_type_key(
         state['high_level_num_cat'], ast.literal_eval)
Ejemplo n.º 2
0
 def set_state(self, state):
     super().set_state(state)
     self._one_hot_encoder = encoder.deserialize(state['one_hot_encoder'])
     if self._one_hot_encoder:
         self._one_hot_encoder.set_state(state['one_hot_encoder_state'])
     self.num_classes = state['num_classes']
Ejemplo n.º 3
0
 def set_state(self, state):
     super().set_state(state)
     self.label_encoder = encoder.deserialize(state['encoder'])
     if 'encoder_class' in state:
         self.label_encoder.set_state(state['encoder_state'])