Skip to content
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
11 changes: 10 additions & 1 deletion python/federatedml/feature/imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,16 @@ def __get_cols_transform_value(self, data, replace_method, replace_value=None):
LOGGER.debug(f"replace value for feature {feature} is: {transform_value}")
else:
raise ValueError("Unknown replace method:{}".format(replace_method))
cols_transform_value[feature] = transform_value
if (data.schema.get("meta",{}).get("exclusive_data_type",{}).get(feature) is not None):
data_type = data.schema["meta"]["exclusive_data_type"][feature]
if ("str" == data_type):
cols_transform_value[feature] = str(transform_value)
elif ("int" == data_type):
cols_transform_value[feature] = int(transform_value)
else:
cols_transform_value[feature] = float(transform_value)
else:
cols_transform_value[feature] = transform_value

LOGGER.debug(f"cols_transform value is: {cols_transform_value}")
cols_transform_value = [cols_transform_value[key] for key in header]
Expand Down