华为云AI开发平台ModelArts梯度提升树分类特征重要性_云淘科技
概述
采用梯度提升树分类算法计算数据集特征的特征重要性。
输入
参数 |
子参数 |
参数说明 |
---|---|---|
inputs |
dataframe |
参数必选,表示输入的数据集;如果没有pipeline_model和gbt_classify_model参数,表示直接根据数据集训练gbdt分类模型得到特征重要性 |
pipeline_model |
参数可选,如果含有该参数,表示根据上游的pyspark pipeline模型对象pipeline_model来计算特征重要性 |
|
gbt_classify_model |
参数可选,如果含有该参数,表示根据上游的gbt_classify_model对象来计算特征重要性 |
输出
特征重要性结果数据集
参数说明
参数 |
子参数 |
参数说明 |
---|---|---|
input_columns_str |
– |
数据集的特征列名组成的格式化字符串,例如: “column_a” “column_a,column_b” |
label_col |
– |
目标列名 |
model_input_features_col |
– |
特征向量的列名 |
classifier_label_index_col |
– |
将目标列按照标签编码后的列名,默认为”label_index” |
prediction_index_col |
– |
训练模型时,预测结果对应标签的列名,默认为”prediction_index” |
prediction_col |
– |
训练模型时,预测结果对应的列名,默认为”prediction” |
max_depth |
– |
树的最大深度 |
max_bins |
– |
特征分裂时的最大分箱个数 |
min_instances_per_node |
– |
树分裂时要求每个节点必须包含的实例数目,默认为1 |
min_info_gain |
– |
最小信息增益 |
max_iter |
– |
最大迭代次数 |
step_size |
– |
步长 |
subsampling_rate |
– |
训练每棵树时,对训练集的抽样率 |
样例
inputs = { "dataframe": None, # @input {"label":"dataframe","type":"DataFrame"} "pipeline_model": None, # @input {"label":"pipeline_model","type":"PipelineModel"} "gbt_classify_model": None } params = { "inputs": inputs, "input_columns_str": "", # @param {"label": "input_columns_str", "type": "string", "required": "false", "helpTip": ""} "label_col": "", # @param {"label": "label_col", "type": "string", "required": "true", "helpTip": ""} "model_input_features_col": "model_features", # @param {"label": "model_input_features_col", "type": "string", "required": "false", "helpTip": ""} "classifier_label_index_col": "label_index", # @param {"label": "classifier_label_index_col", "type": "string", "required": "false", "helpTip": ""} "prediction_index_col": "prediction_index", # @param {"label": "prediction_index_col", "type": "string", "required": "false", "helpTip": ""} "prediction_col": "prediction", # @param {"label": "prediction_col", "type": "string", "required": "false", "helpTip": ""} "max_depth": 5, # @param {"label": "max_depth", "type": "integer", "required": "false","range":"(0,2147483647]", "helpTip": ""} "max_bins": 32, # @param {"label": "max_bins", "type": "integer", "required": "false","range":"(0,2147483647]", "helpTip": ""} "min_instances_per_node": 1, # @param {"label": "min_instances_per_node", "type": "integer", "required": "false","range":"(0,2147483647]", "helpTip": ""} "min_info_gain": 0.0, # @param {"label": "min_info_gain", "type": "number", "required": "false", "helpTip": ""} "loss_type": "logistic", "max_iter": 20, # @param {"label": "max_iter", "type": "integer", "required": "false","range":"(0,2147483647]", "helpTip": ""} "step_size": 0.1, # @param {"label": "step_size", "type": "number", "required": "false", "helpTip": ""} "subsampling_rate": 1.0 # @param {"label": "subsampling_rate", "type": "number", "required": "false", "helpTip": ""} } gbt_classifier_feature_importance____id___ = MLSGBTClassifierFeatureImportance(**params) gbt_classifier_feature_importance____id___.run() # @output {"label":"dataframe","name":"gbt_classifier_feature_importance____id___.get_outputs()['output_port_1']","type":"DataFrame"}
父主题: 数据分析
同意关联代理商云淘科技,购买华为云产品更优惠(QQ 78315851)
内容没看懂? 不太想学习?想快速解决? 有偿解决: 联系专家