跳转至

OneHot Encoder

OneHot encoding is a process by which category variables are converted to binary values. The detailed info could be found in OneHot wiki

Param

onehot_encoder_param

Classes

OneHotEncoderParam(transform_col_indexes=-1, transform_col_names=None, need_run=True)

Bases: BaseParam

Parameters:

Name Type Description Default
transform_col_indexes

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

Indicate if this module needed to be run

True
Source code in python/federatedml/param/onehot_encoder_param.py
35
36
37
38
39
40
41
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
Attributes
transform_col_indexes = transform_col_indexes instance-attribute
transform_col_names = transform_col_names instance-attribute
need_run = need_run instance-attribute
Functions
check()
Source code in python/federatedml/param/onehot_encoder_param.py
43
44
45
46
47
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

最后更新: 2021-11-15