Shared Concepts

AUTOTUNE Statement

  • AUTOTUNE <options>;

This section applies to the following procedures: BNET, FACTMAC, FOREST, GRADBOOST, MTLEARN, NNET, SEMISUPLEARN, SVMACHINE, and TSNE.

Table 1 summarizes the options you can specify in the AUTOTUNE statement. All options except the TUNINGPARAMETERS= option are described in detail in the list that follows Table 1. For more information about the TUNINGPARAMETERS= option, see the specific procedure chapter.

Table 1: AUTOTUNE Statement Options

Option Description
APPENDLOOKUP Specifies that the table specified in the HISTORYTABLE= option contain the rows from the table specified in the LOOKUPTABLE= option
EVALHISTORY= Specifies how to report the evaluation history of the tuner
FRACTION= Specifies the fraction of observations to use for validation
HISTORYTABLE= Specifies the CAS table that contains the evaluation history
KFOLD= Specifies the number of folds for k-fold cross validation
LIVEUPDATE Specifies that the table specified in the HISTORYTABLE= option be updated at every evaluation
LOOKUPTABLE= Specifies the CAS table to use for evaluation lookup
MAXBAYES= Specifies the maximum number of points in the kriging model
MAXEVALS= Specifies the maximum number of evaluations
MAXITER= Specifies the maximum number of iterations when SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN
MAXTIME= Specifies the maximum time for all iterations
MAXTRAINTIME= Specifies the maximum time for a model training
NCONVITER= Specifies the number of convergence iterations
NOGRIDSHUFFLE Requests that the grid points not be shuffled
NOLOCALSEARCH Disables local search optimization
NPARALLEL= Specifies the number of parallel sessions
NSUBSESSIONWORKERS= Specifies the number of workers in parallel sessions
OBJECTIVE= Specifies the objective function
POPSIZE= Specifies the population size when SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN
SAMPLESIZE= Specifies the sample size when SEARCHMETHOD=LHS or SEARCHMETHOD=RANDOM
SEARCHMETHOD= Specifies the search method that the optimizer uses
SECONDOBJECTIVE= Specifies the second objective to use for tuning
SELECTINITPOINT Specifies that the tuner select the best evaluation from the lookup table
TARGETEVENT= Specifies the target event for ROC-based calculations
TRAINFRACTION= Specifies the fraction of observations to use for training
TUNINGPARAMETERS= Specifies the custom tuning parameters
USEPARAMETERS= Specifies how to handle the TUNINGPARAMETERS= option


APPENDLOOKUP

specifies that the rows from the table specified in the LOOKUPTABLE= option be appended to the output table that is created using the HISTORYTABLE= option.

This option is ignored if you do not specify both the HISTORYTABLE= and LOOKUPTABLE= options.

EVALHISTORY=ALL |LOG |NONE |TABLE

specifies how to report the evaluation history of the tuner.

You can specify one of the following values:

ALL

reports each evaluation in the log and creates the EvaluationHistory ODS table.

LOG

prints the following information to the log for each evaluation: evaluation number, objective value, best objective value up to that point, evaluation time, and elapsed time since the beginning of the tuning process.

NONE

suppresses reporting of evaluations in the log and does not create the EvaluationHistory ODS table.

TABLE

creates the EvaluationHistory ODS table, which contains all evaluated points. The table contains columns for the evaluation number, all tuning parameters, and the objective function value.

By default, EVALHISTORY=TABLE.

FRACTION=number

specifies the fraction of all data to be used for validation, where number must be between 0.01 and 0.99, inclusive. If you specify this option, the tuner uses a single-partition validation for finding the objective value (validation error estimate). Using this option might not be advisable for small or unbalanced data tables, where the random assignment of the validation subset might not provide a good estimate of error. For large, balanced data tables, a single-partition validation is usually sufficient for estimating error; a single partition is more efficient than cross validation in terms of the total execution time.

If a PARTITION statement is specified, the validation partition defined in that statement is used, and this option is ignored. You cannot specify this option in combination with the KFOLD= option.

If the TRAINFRACTION= option is used, then by default the value of the FRACTION= option is one minus the value of the TRAINFRACTION= option. Otherwise, by default, FRACTION=0.3.

HISTORYTABLE=CAS-libref.data-table

specifies the data table created by the tuning process that contains the evaluation history. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, and data-table specifies the name of the output data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs.

KFOLD=number

specifies the number of folds (partitions) in the cross validation process, where number must be between 2 and 20, inclusive. If you specify this option, the tuner uses cross validation to find the objective value. In cross validation, each model evaluation requires number of training executions (on number–1 data folds) and number of scoring executions (on one hold-out fold). Thus, the evaluation time is increased by approximately a factor of number. For small to medium data tables or for unbalanced data tables, cross validation provides on average a better representation of error across the entire data table (a better generalization error).

If you do not specify either this option or the FRACTION= option, then the default of FRACTION=0.3 is used. If a PARTITION statement is specified, the validation partition defined in that statement is used, and this option is ignored. You cannot specify this option in combination with the FRACTION= option.

LIVEUPDATE

specifies that the table specified in the HISTORYTABLE= option be updated at every evaluation. This option forces the table to be a promoted CAS table so that it can be seen by other sessions.

This option is ignored if you do not specify the HISTORYTABLE= option.

LOOKUPTABLE=CAS-libref.data-table

specifies the data table previously created by the tuning process that you want to use as the lookup table. CAS-libref.data-table is a two-level name, where CAS-libref refers to the caslib and session identifier, and data-table specifies the name of the input data table. For more information about this two-level name, see the section Using CAS Sessions and CAS Engine Librefs.

MAXBAYES=number

specifies the maximum number of points in the Kriging model. This option is honored only when SEARCHMETHOD=BAYESIAN and when number has a minimum value of 10.

By default, MAXBAYES=100.

MAXEVALS=number

specifies the maximum number of configuration evaluations allowed for the tuner, where number must be an integer greater than or equal to 3. When the number of evaluations is reached, the tuner terminates the search and returns the results. To produce a single objective function value (validation error estimate), each configuration evaluation requires either a single model training and scoring execution on a validation partition, or a number of training and scoring executions equal to the value of the KFOLD= option for cross validation. The MAXEVALS= option might lead to termination before the value of the MAXITER= option or the MAXTIME= option is reached.

By default, MAXEVALS=50.

MAXITER=number

specifies the maximum number of iterations of the optimization tuner, where number must be greater than or equal to 1. Each iteration normally involves a number of objective evaluations up to the value of the POPSIZE= option. The MAXITER= option is used only when SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN; it is ignored when SEARCHMETHOD=RANDOM or SEARCHMETHOD=LHS. The MAXITER= option might lead to termination before the value of the MAXEVALS= option or the MAXTIME= option is reached.

By default, MAXITER=5.

MAXTIME=number

specifies the maximum time (in seconds) allowed for the tuner, where number must be greater than or equal to 1. When this value is reached, the tuner terminates the search and returns results. The actual run time for optimization might be longer because it includes the remaining time needed to finish the current evaluation. For long-running model training (large data tables), the actual run time might significantly exceed number. The MAXTIME= option might lead to termination before the value of the MAXEVALS= option or the MAXITER= option is reached.

By default, MAXTIME=36000.

MAXTRAINTIME=number

specifies the maximum time allowed for a single model train. The model train is terminated if it exceeds this time, and the objective value is set to missing.

By default, there is no maximum time allowed for a single train.

NCONVITER=number

specifies the number of convergence iterations after which tuning is terminated.

By default, NCONVITER=4.

NOGRIDSHUFFLE

requests that the points that are generated by the grid search method not be shuffled before execution.

NOLOCALSEARCH

disables local search optimization for the tuning process.

By default, local search optimization is enabled.

NPARALLEL=number

specifies the number of evaluations to be performed in parallel, where number must be greater than or equal to 0.

By default, NPARALLEL=0, which indicates that the value of number is determined as follows:

  • If SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN, then the number of parallel evaluations is equal to the value of the POPSIZE= option minus 1.

  • If SEARCHMETHOD=LHS or SEARCHMETHOD=RANDOM, then the number of parallel evaluations is equal to the value of the SAMPLESIZE= option, with a maximum value of 32.

NSUBSESSIONWORKERS=number

specifies the number of workers to use in parallel subsessions. When alternative configurations are evaluated in parallel, a number of subsessions is created by the tuner, with each using multiple workers. By default, the number of workers that are used in a parallel subsession is determined as described in the section Determining the Number of Parallel Evaluations.

OBJECTIVE=function

specifies which measure of model performance the tuner uses as the objective function.

You can specify one of the following values for function. Some values can be specified only when the target variable is of a particular type, as shown in parentheses.

ASE

uses average squared error as the objective function.

AUC

uses area under the curve as the objective function (nominal type only).

F05

uses the F0.5 coefficient as the objective function (nominal type only).

F1

uses the F1 coefficient as the objective function (nominal type only).

GAMMA

uses the gamma coefficient as the objective function (nominal type only).

GINI

uses the Gini coefficient as the objective function (nominal type only).

KS

uses the Kolmogorov-Smirnov coefficient as the objective function (nominal type only).

MAE

uses the mean absolute error as the objective function (interval type only).

MCE

uses the misclassification rate as the objective function (nominal type only).

MCLL

uses the multiclass log loss as the objective function (nominal type only).

MISC

uses the misclassification error percentage as the objective function (nominal type only).

MSE

uses the mean squared error as the objective function (interval type only).

MSLE

uses the mean squared logarithmic error as the objective function (interval type only).

RASE

uses the root average squared error as the objective function.

RMAE

uses the root mean absolute error as the objective function (interval type only).

RMSLE

uses the root mean squared logarithmic error as the objective function (interval type only).

TAU

uses the tau coefficient as the objective function (nominal type only).

By default, OBJECTIVE=MISC for nominal targets, and OBJECTIVE=MSE for interval targets.

POPSIZE=number

specifies the maximum population size, where population is the number of configuration evaluations in one iteration (population). The number must be greater than or equal to 1. In some cases, the tuner algorithm might generate a number of new configurations that is smaller than number. The POPSIZE= option is used only when SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN; it is ignored when SEARCHMETHOD=RANDOM or SEARCHMETHOD=LHS.

By default, POPSIZE=10.

SAMPLESIZE=number

specifies the total number of evaluations, where number must be greater than or equal to 1. This option is only used when SEARCHMETHOD=RANDOM or SEARCHMETHOD=LHS; it is ignored when SEARCHMETHOD=GA or SEARCHMETHOD=BAYESIAN.

By default, SAMPLESIZE=50.

SEARCHMETHOD=BAYESIAN |GA |GRID |LHS |RANDOM

specifies the search method to use for tuning. You can specify the following values:

BAYESIAN

builds a kriging surrogate model to approximate the objective value and uses this surrogate model to generate new alternative configurations at each iteration. The kriging model is continuously updated during the search process.

GA

uses an initial Latin hypercube sample that seeds a genetic algorithm to generate a new population of alternative configurations at each iteration.

GRID

uses all combinations of selected values of the hyperparameters.

LHS

uses a Latin hypercube to generate a single sample of configurations that is uniform in each tuning parameter but random in combinations.

RANDOM

generates a single sample of purely random configurations.

By default, SEARCHMETHOD=GA.

SECONDOBJECTIVE=NONE |SCORETIME |TRAINTIME

specifies the type of the second objective to use for tuning. You can specify the following values:

NONE

does not use a second objective for tuning.

SCORETIME

specifies the model scoring time as the second objective for tuning.

TRAINTIME

specifies the model training time as the second objective for tuning.

By default, SECONDOBJECTIVE=NONE.

SELECTINITPOINT

specifies that the tuner select the best evaluation from the table specified in the LOOKUPTABLE= option as the initial point for the tuning process.

This option is ignored if you do not specify the LOOKUPTABLE= option.

TARGETEVENT=string

specifies the target event to use for calculating the selected objective function. This option is ignored when the value of the OBJECTIVE= option is not AUC, F1, F05, GINI, GAMMA, TAU, or KS.

If you do not specify the TARGETEVENT= option, the tuner selects one of the target levels and uses it for calculating the specified objective function.

TRAINFRACTION=number

specifies the fraction of all data to be used for training, where number must be between 0.01 and 0.99, inclusive. If you specify this option, the tuner uses a single-partition validation to find the objective value (validation error estimate). Using this option might not be advisable for small or unbalanced data tables, where the random assignment of the validation subset might not provide a good estimate of error. For large, balanced data tables, a single-partition validation is usually sufficient for estimating error; a single partition is more efficient than cross validation in terms of the total execution time.

If a PARTITION statement is specified, the validation partition defined in that statement is used, and this option is ignored. You cannot specify this option in combination with the KFOLD= option.

If the FRACTION= option is used, then by default the value of the TRAINFRACTION= option is one minus the value of the FRACTION= option. Otherwise, by default, TRAINFRACTION=0.7.

TUNINGPARAMETERS=(suboption |…|<suboption>)
TUNEPARMS=(suboption |…|<suboption>)

specifies which parameters to tune and which ranges to tune over. If USEPARAMETERS=STANDARD, this option is ignored.

For more information about which tuning suboptions are available, see the specific procedure chapters.

USEPARAMETERS=COMBINED |CUSTOM |STANDARD

specifies which set of parameters to tune.

You can specify the following values:

COMBINED

tunes the parameters that are specified in the TUNINGPARAMETERS= option and uses default bounds and initial values to tune all other parameters.

CUSTOM

tunes only the parameters that are specified in the TUNINGPARAMETERS= option.

STANDARD

tunes all parameters by using their default bounds and initial values.

By default, USEPARAMETERS=COMBINED.

Last updated: November 11, 2020