Scores a table using a gradient boosting tree model.
| Parameter | Description |
|---|---|
| applyRowOrder | Specifies that you wish the action use a prespecified row ordering. This requires using the orderby and groupby parameters on a preliminary table.partition action call. Default: FALSE |
| assess | When set to True, predicted probabilities are added to the result table for the event levels. You can use these predicted probabilities with the assess action. Default: FALSE |
| assessOneRow | When set to True, predicted probabilities are added to the result table for the event levels. All event probabilities are included as separate columns and are named with the prefix _DT_P_. You can use these predicted probabilities with the assess action. Default: FALSE |
| casOut | Specifies the table to store the scored results in. When not specified, the action scores the data set and computes only the mis-classification rate for classifications and mean squared error for regressions. It includes subparameters like caslib, compress, indexVars, label, lifetime, maxMemSize, memoryFormat, name, promote, replace, replication, tableRedistUpPolicy, threadBlockSize, timeStamp, and where. |
| copyVars | Specifies the variables to transfer from the input table to the output table. Alias: copyVar |
| encodeName | Specifies whether to encode the variable names such as predicted probabilities of a binary or nominal target in the generated casout table. The predicted probabilities are named with the prefix P_ instead of _DT_P_. Default: FALSE |
| includeMissing | By default, observations with missing values are included. When set to False, observations with missing values for the variables used in the tree model are ignored when scoring. Default: TRUE |
| modelId | Specifies the model ID variable name to use when generating the scored table. By default, the variable name is _DT_PredName_ for classifications, _DT_PredLowerbd_ and _DT_PredUpperbd_ for a binned target, and _DT_PredMean_ for regressions. |
| modelTable | Specifies the table containing the model. Required. Alias: model. It includes subparameters like caslib, computedOnDemand (Alias: compOnDemand, Default: FALSE), computedVars, computedVarsProgram (Alias: compPgm), dataSourceOptions (Aliases: options, dataSource), importOptions (Alias: import), name (Required), singlePass (Default: FALSE), vars, where, and whereTable. |
| nTree | Specifies the number of trees to use while scoring. Alias: nTrees. Default: MACINT. Minimum value: 1 |
| offset | Specifies the offset variable name. |
| rbaImp | Specifies variable importance using the random branch assignments (RBA) method. Default: FALSE |
| seed | Specifies the seed for the random number generator. By default, the random number stream is based on the computer clock. Negative values also result in random number streams based on the computer clock. If you want a reproducible random number sequence between runs, specify a value that is greater than zero. Default: 0. Range: 0–MACINT |
| table | Specifies the settings for an input table. Required. It includes subparameters like caslib, computedOnDemand (Alias: compOnDemand, Default: FALSE), computedVars, computedVarsProgram (Alias: compPgm), dataSourceOptions (Aliases: options, dataSource), importOptions (Alias: import), name (Required), singlePass (Default: FALSE), vars, where, and whereTable. |
| target | Specifies the target variable when scoring a data set. If the target variable name in the tree model is the same in the scored table, then this option is not required. |
| treeVotes | Requests that the scored table generated by scoring forest is enhanced with information about the votes of the individual trees. Default: FALSE |
| varIntImp | Requests variable interaction importance and specifies the maximum degree of interaction. Default: 1. Range: 0–3 |
This is a placeholder for data creation. Actual data creation steps would depend on the specific use case and source data.
| 1 | /* No specific |
| 2 | data creation code found in the provided HTML. */ |
| 3 | /* Example of loading a table: */ |
| 4 | /* cas.table.loadTable(caslib='mylib', path='mydata.sashdat', casOut={'name':'mydata', 'replace':True}) */ |
This example shows how to score an input table using a pre-trained gradient boosting tree model.
| 1 | PROC CAS; |
| 2 | decisionTree.gbtreeScore / |
| 3 | modelTable={name='myGradientBoostModel'}, |
| 4 | TABLE={name='inputData'}, |
| 5 | casOut={name='scoredData', replace=True}; |
| 6 | RUN; |
| 7 | QUIT; |
This example demonstrates scoring with a gradient boosting tree model, copying specific variables from the input to the output table, and enabling assessment for predicted probabilities.
| 1 | PROC CAS; |
| 2 | decisionTree.gbtreeScore / |
| 3 | modelTable={name='myGradientBoostModel', caslib='models'}, |
| 4 | TABLE={name='inputData', caslib='public'}, |
| 5 | casOut={name='scoredDataWithDetails', replace=True}, |
| 6 | copyVars={'customer_id', 'feature1', 'feature2'}, |
| 7 | assess=True, |
| 8 | encodeName=True; |
| 9 | RUN; |
| 10 | QUIT; |