跳转至

Homo 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

homo_onehot_encoder_param

Classes

HomoOneHotParam(transform_col_indexes=-1, transform_col_names=None, need_run=True, need_alignment=True)

Bases: BaseParam

Parameters:

Name Type Description Default
transform_col_indexes

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

-1
need_run

Indicate if this module needed to be run

True
need_alignment

Indicated whether alignment of features is turned on

True
Source code in federatedml/param/homo_onehot_encoder_param.py
24
25
26
27
28
29
def __init__(self, transform_col_indexes=-1, transform_col_names=None, need_run=True, need_alignment=True):
    super(HomoOneHotParam, self).__init__()
    self.transform_col_indexes = transform_col_indexes
    self.transform_col_names = transform_col_names
    self.need_run = need_run
    self.need_alignment = need_alignment
Attributes
transform_col_indexes = transform_col_indexes instance-attribute
transform_col_names = transform_col_names instance-attribute
need_run = need_run instance-attribute
need_alignment = need_alignment instance-attribute
Functions
check()
Source code in federatedml/param/homo_onehot_encoder_param.py
31
32
33
34
35
36
37
38
def check(self):
    descr = "One-hot encoder with alignment param's"
    self.check_defined_type(self.transform_col_indexes, descr, ['list', 'int'])
    self.check_boolean(self.need_run, descr)
    self.check_boolean(self.need_alignment, descr)

    self.transform_col_names = [] if self.transform_col_names is None else self.transform_col_names
    return True

最后更新: 2021-11-15