decisionTree

gbtreeScore

Description

Scores a table using a gradient boosting tree model.

decisionTree.gbtreeScore <result=results> <status=rc> / applyRowOrder=TRUE | FALSE, assess=TRUE | FALSE, assessOneRow=TRUE | FALSE, casOut={caslib="string", compress=TRUE | FALSE, indexVars={"variable-name-1" <, "variable-name-2", ...>}, label="string", lifetime=64-bit-integer, maxMemSize=64-bit-integer, memoryFormat="DVR" | "INHERIT" | "STANDARD", name="table-name", promote=TRUE | FALSE, replace=TRUE | FALSE, replication=integer, tableRedistUpPolicy="DEFER" | "NOREDIST" | "REBALANCE", threadBlockSize=64-bit-integer, timeStamp="string", where={"string-1" <, "string-2", ...>}}, copyVars={"variable-name-1" <, "variable-name-2", ...>}, encodeName=TRUE | FALSE, includeMissing=TRUE | FALSE, modelId="string", modelTable={caslib="string", computedOnDemand=TRUE | FALSE, computedVars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}}, computedVarsProgram="string", dataSourceOptions={key-1=any-list-or-data-type-1 <, key-2=any-list-or-data-type-2, ...>}, importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}, name="table-name", singlePass=TRUE | FALSE, vars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}}, where="where-expression", whereTable={casLib="string" dataSourceOptions={adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters} importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters} name="table-name" vars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}} where="where-expression"} }, nTree=integer, offset="variable-name", rbaImp=TRUE | FALSE, seed=double, table={caslib="string", computedOnDemand=TRUE | FALSE, computedVars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}}, computedVarsProgram="string", dataSourceOptions={key-1=any-list-or-data-type-1 <, key-2=any-list-or-data-type-2, ...>}, importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters}, name="table-name", singlePass=TRUE | FALSE, vars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}}, where="where-expression", whereTable={casLib="string" dataSourceOptions={adls_noreq-parameters | bigquery-parameters | cas_noreq-parameters | clouddex-parameters | db2-parameters | dnfs-parameters | esp-parameters | fedsvr-parameters | gcs_noreq-parameters | hadoop-parameters | hana-parameters | impala-parameters | informix-parameters | jdbc-parameters | mongodb-parameters | mysql-parameters | odbc-parameters | oracle-parameters | path-parameters | postgres-parameters | redshift-parameters | s3-parameters | sapiq-parameters | sforce-parameters | singlestore_standard-parameters | snowflake-parameters | spark-parameters | spde-parameters | sqlserver-parameters | ss_noreq-parameters | teradata-parameters | vertica-parameters | yellowbrick-parameters} importOptions={fileType="ANY" | "AUDIO" | "AUTO" | "BASESAS" | "CSV" | "DELIMITED" | "DOCUMENT" | "DTA" | "ESP" | "EXCEL" | "FMT" | "HDAT" | "IMAGE" | "JMP" | "LASR" | "PARQUET" | "SOUND" | "SPSS" | "VIDEO" | "XLS", fileType-specific-parameters} name="table-name" vars={{format="string", formattedLength=integer, label="string", name="variable-name", nfd=integer, nfl=integer}, {...}} where="where-expression"} }, target="variable-name", treeVotes=TRUE | FALSE, varIntImp=integer;
Settings
ParameterDescription
applyRowOrderSpecifies 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
assessWhen 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
assessOneRowWhen 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
casOutSpecifies 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.
copyVarsSpecifies the variables to transfer from the input table to the output table. Alias: copyVar
encodeNameSpecifies 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
includeMissingBy 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
modelIdSpecifies 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.
modelTableSpecifies 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.
nTreeSpecifies the number of trees to use while scoring. Alias: nTrees. Default: MACINT. Minimum value: 1
offsetSpecifies the offset variable name.
rbaImpSpecifies variable importance using the random branch assignments (RBA) method. Default: FALSE
seedSpecifies 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
tableSpecifies 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.
targetSpecifies 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.
treeVotesRequests that the scored table generated by scoring forest is enhanced with information about the votes of the individual trees. Default: FALSE
varIntImpRequests variable interaction importance and specifies the maximum degree of interaction. Default: 1. Range: 0–3
Data Preparation View data prep sheet
Example Data Preparation (Hypothetical)

This is a placeholder for data creation. Actual data creation steps would depend on the specific use case and source data.

Copied!
1/* No specific
2data 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}) */

Examples

This example shows how to score an input table using a pre-trained gradient boosting tree model.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2decisionTree.gbtreeScore /
3 modelTable={name='myGradientBoostModel'},
4 TABLE={name='inputData'},
5 casOut={name='scoredData', replace=True};
6RUN;
7QUIT;
Result :
The 'scoredData' table will be created containing the predictions from 'myGradientBoostModel' applied to 'inputData'.

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2decisionTree.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;
9RUN;
10QUIT;
Result :
The 'scoredDataWithDetails' table will be created. It will include predictions from 'myGradientBoostModel' applied to 'inputData', along with 'customer_id', 'feature1', and 'feature2'. Predicted probabilities will be added and named with the prefix P_.

FAQ

What is the gbtreeScore Action?
applyRowOrder
assess
assessOneRow
casOut
copyVars
encodeName
includeMissing
modelId
modelTable
nTree
offset
rbaImp
seed
table
target
treeVotes
varIntImp