Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为DataTransform组件增加更细粒度的缺失值填充参数设置 #4929

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions python/federatedml/util/data_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def __init__(self, data_transform_param):
else:
self.exclusive_data_type = None

self.col_missing_fill_method = data_transform_param.col_missing_fill_method

def _update_param(self, schema):
meta = schema["meta"]
self.delimitor = meta.get("delimiter", ",")
Expand Down Expand Up @@ -229,7 +231,8 @@ def fill_missing_value(self, input_data_features, mode="fit"):
if mode == "fit":
input_data_features, self.default_value = imputer_processor.fit(input_data_features,
replace_method=self.missing_fill_method,
replace_value=self.default_value)
replace_value=self.default_value,
col_replace_method=self.col_missing_fill_method)
if self.missing_impute is None:
self.missing_impute = imputer_processor.get_missing_value_list()
else:
Expand Down Expand Up @@ -693,6 +696,7 @@ def __init__(self, data_transform_param):
self.missing_impute = None
self.anonymous_generator = None
self.anonymous_header = None
self.col_missing_fill_method = data_transform_param.col_missing_fill_method

def _update_param(self, schema):
meta = schema["meta"]
Expand Down Expand Up @@ -806,7 +810,8 @@ def fill_missing_value(self, input_data, tags_dict, schema, mode="fit"):
if mode == "fit":
data, self.default_value = imputer_processor.fit(input_data,
replace_method=self.missing_fill_method,
replace_value=self.default_value)
replace_value=self.default_value,
col_replace_method=self.col_missing_fill_method)
LOGGER.debug("self.default_value is {}".format(self.default_value))
else:
data = imputer_processor.transform(input_data,
Expand Down