Gradient boosting decision tree (GBDT) is an iterative decision tree algorithm that is suitable for linear and nonlinear regression scenarios.

Configure the component

You can use one of the following methods to configure the GBDT Regression component.

Method 1: Configure the component on the pipeline page

You can configure the parameters of the GBDT Regression component on the pipeline page of Machine Learning Designer of Machine Learning Platform for AI (PAI). Machine Learning Designer is formerly known as Machine Learning Studio. The following table describes the parameters.
TabParameterDescription
Fields SettingInput ColumnsThe feature columns that are selected from the input table for training. The columns of the DOUBLE and BIGINT types are supported
Note A maximum of 800 feature columns can be selected.
Label ColumnThe label column. The columns of the DOUBLE and BIGINT types are supported.
Group ColumnThe columns of the DOUBLE and BIGINT types are supported. By default, the full table is a group.
Parameters SettingLoss Function TypeThe type of the loss function. Valid values: Gbrank Loss, Lambdamart DCG Loss, Lambdamart NDCG Loss, and Regression Loss.
Tau in gbrank lossThis parameter is required only if the Loss Function Type parameter is set to Gbrank Loss. Valid values: [0,1].
Exponent Base of Gbrank and Regression LossThis parameter is required only if the Loss Function Type parameter is set to Gbrank Loss or Regression Loss. Valid values: [1,10].
Metric TypeThe metric type. Valid values: NDCG and DCG.
Number of Decision TreesThe number of trees. Valid values: 1 to 10000.
Learning RateThe learning rate. Valid values: (0,1).
Maximum Leaf QuantityThe maximum number of leaf nodes on each tree. Valid values: 1 to 1000.
Maximum Decision Tree DepthThe maximum depth of each tree. Valid values: 1 to 100.
Minimum Sample Quantity on a Leaf NodeThe minimum number of samples on each leaf node. Valid values: 1 to 1000.
Sample RatioThe proportion of samples that are selected for training. Valid values: (0,1).
Feature RatioThe proportion of features that are selected for training. Valid values: (0,1).
Sample RatioThe proportion of samples that are selected for testing. Valid values: [0,1).
Random SeedThe random seed. Valid values: [0,10].
Use Newton-Raphson MethodSpecifies whether to use Newton's method.
Maximum Feature Split TimesThe maximum number of splits of each feature. Valid values: 1 to 1000.
TuningNumber of Computing CoresThe number of cores. The system automatically allocates cores based on the volume of input data.
Memory Size per CoreThe memory size of each core. The system automatically allocates the memory based on the volume of input data. Unit: MB.

Method 2: Use PAI commands

Configure the component parameters by using PAI commands. You can use the SQL Script component to call PAI commands. For more information, see SQL Script.
PAI -name gbdt
    -project algo_public
    -DfeatureSplitValueMaxSize="500"
    -DlossType="0"
    -DrandSeed="0"
    -DnewtonStep="0"
    -Dshrinkage="0.05"
    -DmaxLeafCount="32"
    -DlabelColName="campaign"
    -DinputTableName="bank_data_partition"
    -DminLeafSampleCount="500"
    -DsampleRatio="0.6"
    -DgroupIDColName="age"
    -DmaxDepth="11"
    -DmodelName="xlab_m_GBDT_83602"
    -DmetricType="2"
    -DfeatureRatio="0.6"
    -DinputTablePartitions="pt=20150501"
    -Dtau="0.6"
    -Dp="1"
    -DtestRatio="0.0"
    -DfeatureColNames="previous,cons_conf_idx,euribor3m"
    -DtreeCount="500"
ParameterRequiredDescriptionDefault value
inputTableNameYesThe name of the input table. N/A
featureColNamesNoThe feature columns that are selected from the input table for training. The columns of the DOUBLE and BIGINT types are supported. All columns of numeric data types
labelColNameYesThe label column in the input table. The columns of the DOUBLE and BIGINT types are supported. N/A
inputTablePartitionsNoThe partitions that are selected from the input table for training. Specify this parameter in one of the following formats:
  • Partition_name=value
  • name1=value1/name2=value2: multi-level partitions
Note If you specify multiple partitions, separate these partitions with commas (,).
All partitions
modelNameYesThe name of the output model. N/A
outputImportanceTableNameNoThe name of the table that provides feature importance. N/A
groupIDColNameNoThe name of the group column. Full table
lossTypeNoThe type of the loss function. Valid values:
  • 0: GBRank
  • 1: LAMBDAMART_DCG
  • 2: LAMBDAMART_NDCG
  • 3: LEAST_SQUARE
0
metricTypeNoThe metric type. Valid values:
  • 0: normalized discounted cumulative gain (NDCG).
  • 1: discounted cumulative gain (DCG).
  • 2: area under the curve (AUC). This metric type is suitable only for the scenario where the value of label is set to 0 or 1(Deprecated).
0
treeCountNoThe number of trees. Valid values: 1 to 10000. 500
shrinkageNoThe learning rate. Valid values: (0,1). 0.05
maxLeafCountNoThe maximum number of leaf nodes on each tree. Valid values: 1 to 1000. 32
maxDepthNoThe maximum depth of each tree. Valid values: 1 to 100. 10
minLeafSampleCountNoThe minimum number of samples on each leaf node. Valid values: 1 to 1000. 500
sampleRatioNoThe proportion of samples selected for training. Valid values: (0,1). 0.6
featureRatioNoThe proportion of features that are selected for training. Valid values: (0,1). 0.6
tauNoThe Tau parameter for the GBRank loss function. Valid values: [0,1]. 0.6
pNoThe p parameter for the GBRank loss function. Valid values: [1,10]. 1
randSeedNoThe random seed. Valid values: [0,10]. 0
newtonStepNoSpecifies whether to use Newton's method. Valid values: 0 and 1. 1
featureSplitValueMaxSizeNoThe maximum number of splits of each feature. Valid values: 1 to 1000. 500
lifecycleNoThe lifecycle of the output table. N/A

Example

  1. Execute the following SQL statements to generate test data:
    drop table if exists gbdt_ls_test_input;
    create table gbdt_ls_test_input
    as
    select
        *
    from
    (
        select
            cast(1 as double) as f0,
            cast(0 as double) as f1,
            cast(0 as double) as f2,
            cast(0 as double) as f3,
            cast(0 as bigint) as label
        from dual
        union all
            select
                cast(0 as double) as f0,
                cast(1 as double) as f1,
                cast(0 as double) as f2,
                cast(0 as double) as f3,
                cast(0 as bigint) as label
        from dual
        union all
            select
                cast(0 as double) as f0,
                cast(0 as double) as f1,
                cast(1 as double) as f2,
                cast(0 as double) as f3,
                cast(1 as bigint) as label
        from dual
        union all
            select
                cast(0 as double) as f0,
                cast(0 as double) as f1,
                cast(0 as double) as f2,
                cast(1 as double) as f3,
                cast(1 as bigint) as label
        from dual
        union all
            select
                cast(1 as double) as f0,
                cast(0 as double) as f1,
                cast(0 as double) as f2,
                cast(0 as double) as f3,
                cast(0 as bigint) as label
        from dual
        union all
            select
                cast(0 as double) as f0,
                cast(1 as double) as f1,
                cast(0 as double) as f2,
                cast(0 as double) as f3,
                cast(0 as bigint) as label
        from dual
    ) a;
    The following test data table gbdt_ls_test_input is generated.
    f0f1f2f3label
    1.00.00.00.00
    0.00.01.00.01
    0.00.00.01.01
    0.01.00.00.00
    1.00.00.00.00
    0.01.00.00.00
  2. Run the following PAI command to submit the training parameters configured for the GBDT Regression component:
    drop offlinemodel if exists gbdt_ls_test_model;
    PAI -name gbdt
        -project algo_public
        -DfeatureSplitValueMaxSize="500"
        -DlossType="3"
        -DrandSeed="0"
        -DnewtonStep="1"
        -Dshrinkage="0.5"
        -DmaxLeafCount="32"
        -DlabelColName="label"
        -DinputTableName="gbdt_ls_test_input"
        -DminLeafSampleCount="1"
        -DsampleRatio="1"
        -DmaxDepth="10"
        -DmetricType="0"
        -DmodelName="gbdt_ls_test_model"
        -DfeatureRatio="1"
        -Dp="1"
        -Dtau="0.6"
        -DtestRatio="0"
        -DfeatureColNames="f0,f1,f2,f3"
        -DtreeCount="10"
  3. Run the following PAI command to submit the parameters configured for the Prediction component:
    drop table if exists gbdt_ls_test_prediction_result;
    PAI -name prediction
        -project algo_public
        -DdetailColName="prediction_detail"
        -DmodelName="gbdt_ls_test_model"
        -DitemDelimiter=","
        -DresultColName="prediction_result"
        -Dlifecycle="28"
        -DoutputTableName="gbdt_ls_test_prediction_result"
        -DscoreColName="prediction_score"
        -DkvDelimiter=":"
        -DinputTableName="gbdt_ls_test_input"
        -DenableSparse="false"
        -DappendColNames="label"
  4. View the prediction result table gbdt_ls_test_prediction_result.
    labelprediction_resultprediction_scoreprediction_detail
    0NULL0.0{"label": 0}
    0NULL0.0{"label": 0}
    1NULL0.9990234375{"label": 0.9990234375}
    1NULL0.9990234375{"label": 0.9990234375}
    0NULL0.0{"label": 0}
    0NULL0.0{"label": 0}