(data, inner_param: OneHotInnerParam)
return col_maps
Generate a new schema based on data value. Each new value will generate a new header.

        Returns
        -------
        col_maps: a dict in which keys are original header, values are dicts. The dicts in value
        e.g.
        cols_map = {"x1": {1 : "x1_1"},
                    ...}
Generate a new schema based on data value. Each new value will generate a new header.
Generate a new schema based on data value . Each new value will generate a new header .
def record_new_header(data, inner_param: OneHotInnerParam):
        """
        Generate a new schema based on data value. Each new value will generate a new header.

        Returns
        -------
        col_maps: a dict in which keys are original header, values are dicts. The dicts in value
        e.g.
        cols_map = {"x1": {1 : "x1_1"},
                    ...}

        """

        col_maps = {}
        for col_name in inner_param.transform_names:
            col_maps[col_name] = TransferPair(col_name)

        for _, instance in data:
            feature = instance.features
            for col_idx, col_name in zip(inner_param.transform_indexes, inner_param.transform_names):
                pair_obj = col_maps.get(col_name)
                feature_value = feature[col_idx]
                if not isinstance(feature_value, str):
                    feature_value = math.ceil(feature_value)
                    if feature_value != feature[col_idx]:
                        raise ValueError("Onehot input data support integer or string only")
                pair_obj.add_value(feature_value)
        return col_maps
def record_new_header ( data , inner_param : OneHotInnerParam ) : col_maps = { } for col_name in inner_param . transform_names : col_maps [ col_name ] = TransferPair ( col_name ) for _ , instance in data : feature = instance . features for col_idx , col_name in zip ( inner_param . transform_indexes , inner_param . transform_names ) : pair_obj = col_maps . get ( col_name ) feature_value = feature [ col_idx ] if not isinstance ( feature_value , str ) : feature_value = math . ceil ( feature_value ) if feature_value != feature [ col_idx ] : raise ValueError ( "Onehot input data support integer or string only" ) pair_obj . add_value ( feature_value ) return col_maps