Model Parameters
Model parameters are used by ModelBuilder
class to
clarify certain behaviors of a tree ensemble model.
-
char pred_transform[TREELITE_MAX_PRED_TRANSFORM_LENGTH] = {0}
name of prediction transform function
This parameter specifies how to transform raw margin values into final predictions. By default, this is set to ‘identity`, which means no transformation.
For the multi-class classification task,
pred_transfrom
must be one of the following values:For all other tasks (e.g. regression, binary classification, ranking etc.),- identity_multiclass do not transform. The output will be a matrix with dimensions [number of data points] * [number of classes] that contains the margin score for every (data point, class) pair. - max_index compute the most probable class for each data point and output the class index. The output will be a vector of length [number of data points] that contains the most likely class of each data point. - softmax use the softmax function to transform a multi-dimensional vector into a proper probability distribution. The output will be a matrix with dimensions [number of data points] * [number of classes] that contains the predicted probability of each data point belonging to each class. - multiclass_ova apply the sigmoid function element-wise to the margin matrix. The output will be a matrix with dimensions [number of data points] * [number of classes].
pred_transfrom
must be one of the following values:- identity Do not transform. The output will be a vector of length [number of data points] that contains the margin score for every data point. - signed_square Apply the function f(x) = sign(x) * (x**2) element-wise to the margin vector. The output will be a vector of length [number of data points]. - hinge Apply the function f(x) = (1 if x > 0 else 0) element-wise to the margin vector. The output will be a vector of length [number of data points], filled with 0's and 1's. - sigmoid Apply the sigmoid function element-wise to the margin vector. The output will be a vector of length [number of data points] that contains the probability of each data point belonging to the positive class. - exponential Apply the exponential function (exp) element-wise to the margin vector. The output will be a vector of length [number of data points]. - exponential_standard_ratio Apply the exponential base 2 function (exp2) element-wise to a standardized version of the margin vector. The output will be a vector of length [number of data points]. Each output element is exp2(-x / c), where x is the margin and c is the standardization constant. - logarithm_one_plus_exp Apply the function f(x) = log(1 + exp(x)) element-wise to the margin vector. The output will be a vector of length [number of data points].
-
float sigmoid_alpha
scaling parameter for sigmoid function
sigmoid(x) = 1 / (1 + exp(-alpha * x))
This parameter is used only when
pred_transform
is set to ‘sigmoid`. It must be strictly positive; if unspecified, it is set to 1.0.
-
float ratio_c
scaling parameter for exponential standard ratio transformation
expstdratio(x) = exp2(-x / c)
This parameter is used only when
pred_transform
is set to ‘exponential_standard_ratio`. If unspecified, it is set to 1.0.
-
float global_bias
global bias of the model
Predicted margin scores of all instances will be adjusted by the global bias. If unspecified, the bias is set to zero.