(self, column_name, value)
return {
            'discrete_column_id': discrete_counter,
            'column_id': column_id,
            'value_id': np.argmax(one_hot)
        }
Get the ids of the given `column_name`.
Get the ids of the given `column_name`.
Get the ids of the given column_name .
def convert_column_name_value_to_id(self, column_name, value):
        """Get the ids of the given `column_name`."""
        discrete_counter = 0
        column_id = 0
        for column_transform_info in self._column_transform_info_list:
            if column_transform_info.column_name == column_name:
                break
            if column_transform_info.column_type == 'discrete':
                discrete_counter += 1

            column_id += 1

        else:
            raise ValueError(f"The column_name `{column_name}` doesn't exist in the data.")

        ohe = column_transform_info.transform
        data = pd.DataFrame([value], columns=[column_transform_info.column_name])
        one_hot = ohe.transform(data).to_numpy()[0]
        if sum(one_hot) == 0:
            raise ValueError(f"The value `{value}` doesn't exist in the column `{column_name}`.")

        return {
            'discrete_column_id': discrete_counter,
            'column_id': column_id,
            'value_id': np.argmax(one_hot)
        }
def convert_column_name_value_to_id ( self , column_name , value ) : discrete_counter = 0 column_id = 0 for column_transform_info in self . _column_transform_info_list : if column_transform_info . column_name == column_name : break if column_transform_info . column_type == 'discrete' : discrete_counter += 1 column_id += 1 else : raise ValueError ( f"The column_name `{column_name}` doesn't exist in the data." ) ohe = column_transform_info . transform data = pd . DataFrame ( [ value ] , columns = [ column_transform_info . column_name ] ) one_hot = ohe . transform ( data ) . to_numpy ( ) [ 0 ] if sum ( one_hot ) == 0 : raise ValueError ( f"The value `{value}` doesn't exist in the column `{column_name}`." ) return { 'discrete_column_id' : discrete_counter , 'column_id' : column_id , 'value_id' : np . argmax ( one_hot ) }