更新时间:2022-11-16 GMT+08:00
分享

缺失值填充

概述

“缺失值填充”节点用来将某些列出现的缺失值(如空值、指定的值)替换为均值或者中位数。

输入

参数

子参数

参数说明

inputs

dataframe

inputs为字典类型,dataframe为pyspark中的DataFrame类型对象

输出

数据集

参数说明

参数

子参数

参数说明

input_features_str

-

列名组成的字符串,例如:

"column_a"

"column_a,column_b"

missing_value

-

类型为数值,表示该值为缺失值,将要被填充

strategy

-

填充策略,支持mean和median

output_col_postfix

-

输出特征列的后缀

样例

inputs = {
    "dataframe": None  # @input {"label":"dataframe","type":"DataFrame"}
}
params = {
    "inputs": inputs,
    "b_output_action": True,
    "outer_pipeline_stages": None,
    "input_features_str": "",  # @param {"label":"input_features_str","type":"string","required":"true","helpTip":""}
    "missing_value": "",  # @param {"label":"missing_value","type":"number","required":"false","range":"(none,none)","helpTip":""}
    "strategy": "mean",  # @param {"label":"strategy","type":"enum","options":"mean,median","required":"true","helpTip":""}
    "output_col_postfix": "_impute"  # @param {"label":"output_col_postfix","type":"string","required":"true","helpTip":""}
}
missing_value_impute____id___ = MLSMissingValueImpute(**params)
missing_value_impute____id___.run()
# @output {"label":"dataframe","name":"missing_value_impute____id___.get_outputs()['output_port_1']","type":"DataFrame"}

分享:

    相关文档

    相关产品