华为云AI开发平台ModelArts标准化_云淘科技

概述

对数据集的某些数值列,根据均值和方差进行标准化。

输入

参数

子参数

参数说明

inputs

dataframe

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

输出

数据集

参数说明

参数

子参数

参数说明

input_features_str

输入的特征列名以逗号分隔组成的格式化字符串,例如:

“column_a”

“column_a,column_b”

input_vector_column

算子输入的向量列的列名,默认为”input_features”

output_vector_column

算子输出的向量列的列名,默认为”standard_features”

with_std

是否按照方差进行标准化,默认为True

with_mean

是否按照均值进行标准化,默认为False

样例

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":"false","helpTip": ""}
    "input_vector_column": "input_features",  # @param {"label":"input_vector_column","type":"string","required":"true","helpTip":""} 
    "output_vector_column": "standard_features",  # @param {"label":"output_vector_column","type":"string","required":"true","helpTip":""} 
    "with_std": True,  # @param {"label":"with_std","type":"boolean","required":"true","helpTip":""}
    "with_mean": False  # @param {"label":"with_mean","type":"boolean","required":"true","helpTip":""}
}
standard_scaler____id___ = MLSStandardScaler(**params)
standard_scaler____id___.run()
# @output {"label":"pipeline_model","name":"standard_scaler____id___.get_outputs()['output_port_1']","type":"PipelineModel"} 
# @output {"label":"dataframe","name":"standard_scaler____id___.get_outputs()['output_port_2']","type":"DataFrame"}

父主题: 特征工程

同意关联代理商云淘科技,购买华为云产品更优惠(QQ 78315851)

内容没看懂? 不太想学习?想快速解决? 有偿解决: 联系专家