华为云AI开发平台ModelArts最小最大规范化_云淘科技

概述

将数据集指定的某些数字列,转换到一定的数值范围(例如0和1之间)。

输入

参数

子参数

参数说明

inputs

dataframe

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

输出

数据集

参数说明

参数

子参数

参数说明

input_features_str

输入的列名以逗号分隔组成的字符串,例如:

“column_a”

“column_a,column_b”

min

转换后的最小值,默认为0.0

max

转换后的最大值,默认为1.0

input_vector_column

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

output_vector_column

结果输出的向量列的列名,默认为”output_scaler_features”

样例

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":""}
    "min": 0.0,  # @param {"label": "min","type":"number","required":"true","range":"(none,none)","helpTip":""}
    "max": 1.0,  # @param {"label":"max","type":"number","required":"true","range":"(none,none)","helpTip":""}
    "input_vector_column": "input_features",  # @param {"label":"input_vector_column","type":"string","required":"true","helpTip":""} 
    "output_vector_column": "minmax_scaler_features"  # @param {"label":"output_vector_column","type":"string","required":"true","helpTip":""} 
}
min_max_scaler____id___ = MLSMinMaxScaler(**params)
min_max_scaler____id___.run()
# @output {"label":"pipeline_model","name":"min_max_scaler____id___.get_outputs()['output_port_1']","type":"PipelineModel"} 
# @output {"label":"dataframe","name":"min_max_scaler____id___.get_outputs()['output_port_2']","type":"DataFrame"}

父主题: 特征工程

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

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