Skip to content

onehot_encoder_param

onehot_encoder_param

Classes

OneHotEncoderParam (BaseParam)

Parameters:

Name Type Description Default
transform_col_indexes list or int, default: -1

Specify which columns need to calculated. -1 represent for all columns.

-1
transform_col_names list of string, default: []

Specify which columns need to calculated. Each element in the list represent for a column name in header.

None
need_run bool, default True

Indicate if this module needed to be run

True
Source code in federatedml/param/onehot_encoder_param.py
class OneHotEncoderParam(BaseParam):
    """

    Parameters
    ----------

    transform_col_indexes: list or int, default: -1
        Specify which columns need to calculated. -1 represent for all columns.

    transform_col_names : list of string, default: []
        Specify which columns need to calculated. Each element in the list represent for a column name in header.


    need_run: bool, default True
        Indicate if this module needed to be run
    """

    def __init__(self, transform_col_indexes=-1, transform_col_names=None, need_run=True):
        super(OneHotEncoderParam, self).__init__()
        if transform_col_names is None:
            transform_col_names = []
        self.transform_col_indexes = transform_col_indexes
        self.transform_col_names = transform_col_names
        self.need_run = need_run

    def check(self):
        descr = "One-hot encoder param's"
        self.check_defined_type(self.transform_col_indexes, descr, ['list', 'int', 'NoneType'])
        self.check_defined_type(self.transform_col_names, descr, ['list', 'NoneType'])
        return True
__init__(self, transform_col_indexes=-1, transform_col_names=None, need_run=True) special
Source code in federatedml/param/onehot_encoder_param.py
def __init__(self, transform_col_indexes=-1, transform_col_names=None, need_run=True):
    super(OneHotEncoderParam, self).__init__()
    if transform_col_names is None:
        transform_col_names = []
    self.transform_col_indexes = transform_col_indexes
    self.transform_col_names = transform_col_names
    self.need_run = need_run
check(self)
Source code in federatedml/param/onehot_encoder_param.py
def check(self):
    descr = "One-hot encoder param's"
    self.check_defined_type(self.transform_col_indexes, descr, ['list', 'int', 'NoneType'])
    self.check_defined_type(self.transform_col_names, descr, ['list', 'NoneType'])
    return True

Last update: 2021-12-03
Back to top