attribute

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OptimizerParamsDocs = map[string]map[string]string{
	"Adadelta": {
		"learning_rate": "A 'Tensor' or a floating point value. The learning rate. To match the exact form in the original paper use 1.0.",
		"rho":           "A 'Tensor' or a floating point value. The decay rate.",
		"epsilon":       "A 'Tensor' or a floating point value. A constant epsilon used to better conditioning the grad update.",
		"name":          "Optional name prefix for the operations created when applying gradients. Defaults to \"Adadelta\".",
	},
	"Adagrad": {
		"learning_rate":             "A 'Tensor' or a floating point value. The learning rate.",
		"initial_accumulator_value": "A floating point value. Starting value for the accumulators, must be positive.",
		"epsilon":                   "A floating point value. Starting value for the accumulators, must be positive.",
		"name":                      "Optional name prefix for the operations created when applying gradients. Defaults to \"Adagrad\".",
	},
	"Adam": {
		"learning_rate": "A Tensor or a floating point value. The learning rate.",
		"beta_1":        "A float value or a constant float tensor. The exponential decay rate for the 1st moment estimates.",
		"beta_2":        "A float value or a constant float tensor. The exponential decay rate for the 2nd moment estimates.",
		"epsilon":       "A small constant for numerical stability. This epsilon is \"epsilon hat\" in the Kingma and Ba paper (in the formula just before Section 2.1), not the epsilon in Algorithm 1 of the paper.",
		"amsgrad":       "boolean. Whether to apply AMSGrad variant of this algorithm from the paper \"On the Convergence of Adam and beyond\".",
		"name":          "Optional name for the operations created when applying gradients. Defaults to \"Adam\". @compatibility(eager) When eager execution is enabled, 'learning_rate', 'beta_1', 'beta_2', and 'epsilon' can each be a callable that takes no arguments and returns the actual value to use. This can be useful for changing these values across different invocations of optimizer functions. @end_compatibility",
	},
	"Adamax": {
		"learning_rate": "A Tensor or a floating point value. The learning rate.",
		"beta_1":        "A float value or a constant float tensor. The exponential decay rate for the 1st moment estimates.",
		"beta_2":        "A float value or a constant float tensor. The exponential decay rate for the exponentially weighted infinity norm.",
		"epsilon":       "A small constant for numerical stability.",
		"name":          "Optional name for the operations created when applying gradients. Defaults to \"Adamax\".",
	},
	"Ftrl": {
		"learning_rate":                        "A float value or a constant float 'Tensor'.",
		"learning_rate_power":                  "A float value, must be less or equal to zero. Controls how the learning rate decreases during training. Use zero for a fixed learning rate.",
		"initial_accumulator_value":            "The starting value for accumulators. Only zero or positive values are allowed.",
		"l1_regularization_strength":           "A float value, must be greater than or equal to zero.",
		"l2_regularization_strength":           "A float value, must be greater than or equal to zero.",
		"name":                                 "Optional name prefix for the operations created when applying gradients. Defaults to \"Ftrl\".",
		"l2_shrinkage_regularization_strength": "A float value, must be greater than or equal to zero. This differs from L2 above in that the L2 above is a stabilization penalty, whereas this L2 shrinkage is a magnitude penalty. The FTRL formulation can be written as: w_{t+1} = argmin_w(\\hat{g}_{1:t}w + L1*||w||_1 + L2*||w||_2^2), where \\hat{g} = g + (2*L2_shrinkage*w), and g is the gradient of the loss function w.r.t. the weights w. Specifically, in the absence of L1 regularization, it is equivalent to the following update rule: w_{t+1} = w_t - lr_t / (1 + 2*L2*lr_t) * g_t - 2*L2_shrinkage*lr_t / (1 + 2*L2*lr_t) * w_t where lr_t is the learning rate at t. When input is sparse shrinkage will only happen on the active weights.\\",
	},
	"Nadam": {
		"learning_rate": "A Tensor or a floating point value. The learning rate.",
		"beta_1":        "A float value or a constant float tensor. The exponential decay rate for the 1st moment estimates.",
		"beta_2":        "A float value or a constant float tensor. The exponential decay rate for the exponentially weighted infinity norm.",
		"epsilon":       "A small constant for numerical stability.",
		"name":          "Optional name for the operations created when applying gradients. Defaults to \"Adamax\".",
	},
	"RMSprop": {
		"learning_rate": "A Tensor or a floating point value. The learning rate.",
		"rho":           "Discounting factor for the history/coming gradient",
		"momentum":      "A scalar tensor.",
		"epsilon":       "Small value to avoid zero denominator.",
		"centered":      "If True, gradients are normalized by the estimated variance of the gradient; if False, by the uncentered second moment. Setting this to True may help with training, but is slightly more expensive in terms of computation and memory. Defaults to False.",
		"name":          "Optional name prefix for the operations created when applying gradients. Defaults to \"RMSprop\". @compatibility(eager) When eager execution is enabled, 'learning_rate', 'decay', 'momentum', and 'epsilon' can each be a callable that takes no arguments and returns the actual value to use. This can be useful for changing these values across different invocations of optimizer functions. @end_compatibility",
	},
	"SGD": {
		"learning_rate": "float hyperparameter >= 0. Learning rate.",
		"momentum":      "float hyperparameter >= 0 that accelerates SGD in the relevant direction and dampens oscillations.",
		"nesterov":      "boolean. Whether to apply Nesterov momentum.",
		"name":          "Optional name prefix for the operations created when applying gradients. Defaults to 'SGD'.",
	},
}

OptimizerParamsDocs stores parameters and documents of optimizers

View Source
var PremadeModelParamsDocs = map[string]map[string]string{
	"DNNClassifier": {
		"hidden_units":     "Iterable of number hidden units per layer. All layers are fully connected. Ex. '[64, 32]' means first layer has 64 nodes and second one has 32.",
		"feature_columns":  "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from '_FeatureColumn'.",
		"model_dir":        "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"n_classes":        "Number of label classes. Defaults to 2, namely binary classification. Must be > 1.",
		"weight_column":    "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"label_vocabulary": "A list of strings represents possible label values. If given, labels must be string type and have any value in 'label_vocabulary'. If it is not given, that means labels are already encoded as integer or float within [0, 1] for 'n_classes=2' and encoded as integer values in {0, 1,..., n_classes-1} for 'n_classes'>2 . Also there will be errors if vocabulary is not provided and labels are string.",
		"optimizer":        "An instance of 'tf.Optimizer' used to train the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to Adagrad optimizer.",
		"activation_fn":    "Activation function applied to each layer. If 'None', will use 'tf.nn.relu'.",
		"dropout":          "When not 'None', the probability we will drop out a given coordinate.",
		"config":           "'RunConfig' object to configure the runtime settings.",
		"warm_start_from":  "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":   "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM_OVER_BATCH_SIZE'.",
		"batch_norm":       "Whether to use batch normalization after each hidden layer.",
	},
	"DNNRegressor": {
		"hidden_units":    "Iterable of number hidden units per layer. All layers are fully connected. Ex. '[64, 32]' means first layer has 64 nodes and second one has 32.",
		"feature_columns": "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from '_FeatureColumn'.",
		"model_dir":       "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"label_dimension": "Number of regression targets per example. This is the size of the last dimension of the labels and logits 'Tensor' objects (typically, these have shape '[batch_size, label_dimension]').",
		"weight_column":   "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"optimizer":       "An instance of 'tf.keras.optimizers.Optimizer' used to train the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to Adagrad optimizer.",
		"activation_fn":   "Activation function applied to each layer. If 'None', will use 'tf.nn.relu'.",
		"dropout":         "When not 'None', the probability we will drop out a given coordinate.",
		"config":          "'RunConfig' object to configure the runtime settings.",
		"warm_start_from": "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":  "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM_OVER_BATCH_SIZE'.",
		"batch_norm":      "Whether to use batch normalization after each hidden layer.",
	},
	"LinearClassifier": {
		"feature_columns":  "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from 'FeatureColumn'.",
		"model_dir":        "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"n_classes":        "number of label classes. Default is binary classification. Note that class labels are integers representing the class index (i.e. values from 0 to n_classes-1). For arbitrary label values (e.g. string labels), convert to class indices first.",
		"weight_column":    "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"label_vocabulary": "A list of strings represents possible label values. If given, labels must be string type and have any value in 'label_vocabulary'. If it is not given, that means labels are already encoded as integer or float within [0, 1] for 'n_classes=2' and encoded as integer values in {0, 1,..., n_classes-1} for 'n_classes'>2 . Also there will be errors if vocabulary is not provided and labels are string.",
		"optimizer":        "An instance of 'tf.Optimizer' or 'tf.estimator.experimental.LinearSDCA' used to train the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to FTRL optimizer.",
		"config":           "'RunConfig' object to configure the runtime settings.",
		"warm_start_from":  "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights and biases are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":   "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM_OVER_BATCH_SIZE'.",
		"sparse_combiner":  "A string specifying how to reduce if a categorical column is multivalent. One of \"mean\", \"sqrtn\", and \"sum\" -- these are effectively different ways to do example-level normalization, which can be useful for bag-of-words features. for more details, see 'tf.feature_column.linear_model'. Returns: A 'LinearClassifier' estimator. Raises: ValueError: if n_classes < 2.",
	},
	"LinearRegressor": {
		"feature_columns": "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from 'FeatureColumn'.",
		"model_dir":       "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"label_dimension": "Number of regression targets per example. This is the size of the last dimension of the labels and logits 'Tensor' objects (typically, these have shape '[batch_size, label_dimension]').",
		"weight_column":   "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"optimizer":       "An instance of 'tf.Optimizer' or 'tf.estimator.experimental.LinearSDCA' used to train the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to FTRL optimizer.",
		"config":          "'RunConfig' object to configure the runtime settings.",
		"warm_start_from": "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights and biases are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":  "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM'.",
		"sparse_combiner": "A string specifying how to reduce if a categorical column is multivalent. One of \"mean\", \"sqrtn\", and \"sum\" -- these are effectively different ways to do example-level normalization, which can be useful for bag-of-words features. for more details, see 'tf.feature_column.linear_model'.",
	},
	"BoostedTreesClassifier": {
		"feature_columns":         "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from 'FeatureColumn'.",
		"n_batches_per_layer":     "the number of batches to collect statistics per layer. The total number of batches is total number of data divided by batch size.",
		"model_dir":               "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"n_classes":               "number of label classes. Default is binary classification. Multiclass support is not yet implemented.",
		"weight_column":           "A string or a 'NumericColumn' created by 'tf.fc_old.numeric_column' defining feature column representing weights. It is used to downweight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a 'NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"label_vocabulary":        "A list of strings represents possible label values. If given, labels must be string type and have any value in 'label_vocabulary'. If it is not given, that means labels are already encoded as integer or float within [0, 1] for 'n_classes=2' and encoded as integer values in {0, 1,..., n_classes-1} for 'n_classes'>2 . Also there will be errors if vocabulary is not provided and labels are string.",
		"n_trees":                 "number trees to be created.",
		"max_depth":               "maximum depth of the tree to grow.",
		"learning_rate":           "shrinkage parameter to be used when a tree added to the model.",
		"l1_regularization":       "regularization multiplier applied to the absolute weights of the tree leafs.",
		"l2_regularization":       "regularization multiplier applied to the square weights of the tree leafs.",
		"tree_complexity":         "regularization factor to penalize trees with more leaves.",
		"min_node_weight":         "min_node_weight: minimum hessian a node must have for a split to be considered. The value will be compared with sum(leaf_hessian)/(batch_size * n_batches_per_layer).",
		"config":                  "'RunConfig' object to configure the runtime settings.",
		"center_bias":             "Whether bias centering needs to occur. Bias centering refers to the first node in the very first tree returning the prediction that is aligned with the original labels distribution. For example, for regression problems, the first node will return the mean of the labels. For binary classification problems, it will return a logit for a prior probability of label 1.",
		"pruning_mode":            "one of 'none', 'pre', 'post' to indicate no pruning, pre- pruning (do not split a node if not enough gain is observed) and post pruning (build the tree up to a max depth and then prune branches with negative gain). For pre and post pruning, you MUST provide tree_complexity >0.",
		"quantile_sketch_epsilon": "float between 0 and 1. Error bound for quantile computation. This is only used for float feature columns, and the number of buckets generated per float feature is 1/quantile_sketch_epsilon.",
		"train_in_memory":         "'bool', when true, it assumes the dataset is in memory, i.e., input_fn should return the entire dataset as a single batch, n_batches_per_layer should be set as 1, num_worker_replicas should be 1, and num_ps_replicas should be 0 in 'tf.Estimator.RunConfig'. Raises: ValueError: when wrong arguments are given or unsupported functionalities are requested.",
	},
	"BoostedTreesRegressor": {
		"feature_columns":         "An iterable containing all the feature columns used by the model. All items in the set should be instances of classes derived from 'FeatureColumn'.",
		"n_batches_per_layer":     "the number of batches to collect statistics per layer. The total number of batches is total number of data divided by batch size.",
		"model_dir":               "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"label_dimension":         "Number of regression targets per example. Multi-dimensional support is not yet implemented.",
		"weight_column":           "A string or a 'NumericColumn' created by 'tf.fc_old.numeric_column' defining feature column representing weights. It is used to downweight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a 'NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"n_trees":                 "number trees to be created.",
		"max_depth":               "maximum depth of the tree to grow.",
		"learning_rate":           "shrinkage parameter to be used when a tree added to the model.",
		"l1_regularization":       "regularization multiplier applied to the absolute weights of the tree leafs.",
		"l2_regularization":       "regularization multiplier applied to the square weights of the tree leafs.",
		"tree_complexity":         "regularization factor to penalize trees with more leaves.",
		"min_node_weight":         "min_node_weight: minimum hessian a node must have for a split to be considered. The value will be compared with sum(leaf_hessian)/(batch_size * n_batches_per_layer).",
		"config":                  "'RunConfig' object to configure the runtime settings.",
		"center_bias":             "Whether bias centering needs to occur. Bias centering refers to the first node in the very first tree returning the prediction that is aligned with the original labels distribution. For example, for regression problems, the first node will return the mean of the labels. For binary classification problems, it will return a logit for a prior probability of label 1.",
		"pruning_mode":            "one of 'none', 'pre', 'post' to indicate no pruning, pre- pruning (do not split a node if not enough gain is observed) and post pruning (build the tree up to a max depth and then prune branches with negative gain). For pre and post pruning, you MUST provide tree_complexity >0.",
		"quantile_sketch_epsilon": "float between 0 and 1. Error bound for quantile computation. This is only used for float feature columns, and the number of buckets generated per float feature is 1/quantile_sketch_epsilon.",
		"train_in_memory":         "'bool', when true, it assumes the dataset is in memory, i.e., input_fn should return the entire dataset as a single batch, n_batches_per_layer should be set as 1, num_worker_replicas should be 1, and num_ps_replicas should be 0 in 'tf.Estimator.RunConfig'. Raises: ValueError: when wrong arguments are given or unsupported functionalities are requested.",
	},
	"DNNLinearCombinedClassifier": {
		"model_dir":              "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"linear_feature_columns": "An iterable containing all the feature columns used by linear part of the model. All items in the set must be instances of classes derived from 'FeatureColumn'.",
		"linear_optimizer":       "An instance of 'tf.Optimizer' used to apply gradients to the linear part of the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to FTRL optimizer.",
		"dnn_feature_columns":    "An iterable containing all the feature columns used by deep part of the model. All items in the set must be instances of classes derived from 'FeatureColumn'.",
		"dnn_optimizer":          "An instance of 'tf.Optimizer' used to apply gradients to the deep part of the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to Adagrad optimizer.",
		"dnn_hidden_units":       "List of hidden units per layer. All layers are fully connected.",
		"dnn_activation_fn":      "Activation function applied to each layer. If None, will use 'tf.nn.relu'.",
		"dnn_dropout":            "When not None, the probability we will drop out a given coordinate.",
		"n_classes":              "Number of label classes. Defaults to 2, namely binary classification. Must be > 1.",
		"weight_column":          "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"label_vocabulary":       "A list of strings represents possible label values. If given, labels must be string type and have any value in 'label_vocabulary'. If it is not given, that means labels are already encoded as integer or float within [0, 1] for 'n_classes=2' and encoded as integer values in {0, 1,..., n_classes-1} for 'n_classes'>2 . Also there will be errors if vocabulary is not provided and labels are string.",
		"config":                 "RunConfig object to configure the runtime settings.",
		"warm_start_from":        "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":         "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM_OVER_BATCH_SIZE'.",
		"batch_norm":             "Whether to use batch normalization after each hidden layer.",
		"linear_sparse_combiner": "A string specifying how to reduce the linear model if a categorical column is multivalent. One of \"mean\", \"sqrtn\", and \"sum\" -- these are effectively different ways to do example-level normalization, which can be useful for bag-of-words features. For more details, see 'tf.feature_column.linear_model'. Raises: ValueError: If both linear_feature_columns and dnn_features_columns are empty at the same time.",
	},
	"DNNLinearCombinedRegressor": {
		"model_dir":              "Directory to save model parameters, graph and etc. This can also be used to load checkpoints from the directory into a estimator to continue training a previously saved model.",
		"linear_feature_columns": "An iterable containing all the feature columns used by linear part of the model. All items in the set must be instances of classes derived from 'FeatureColumn'.",
		"linear_optimizer":       "An instance of 'tf.Optimizer' used to apply gradients to the linear part of the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to FTRL optimizer.",
		"dnn_feature_columns":    "An iterable containing all the feature columns used by deep part of the model. All items in the set must be instances of classes derived from 'FeatureColumn'.",
		"dnn_optimizer":          "An instance of 'tf.Optimizer' used to apply gradients to the deep part of the model. Can also be a string (one of 'Adagrad', 'Adam', 'Ftrl', 'RMSProp', 'SGD'), or callable. Defaults to Adagrad optimizer.",
		"dnn_hidden_units":       "List of hidden units per layer. All layers are fully connected.",
		"dnn_activation_fn":      "Activation function applied to each layer. If None, will use 'tf.nn.relu'.",
		"dnn_dropout":            "When not None, the probability we will drop out a given coordinate.",
		"label_dimension":        "Number of regression targets per example. This is the size of the last dimension of the labels and logits 'Tensor' objects (typically, these have shape '[batch_size, label_dimension]').",
		"weight_column":          "A string or a '_NumericColumn' created by 'tf.feature_column.numeric_column' defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the 'features'. If it is a '_NumericColumn', raw tensor is fetched by key 'weight_column.key', then weight_column.normalizer_fn is applied on it to get weight tensor.",
		"config":                 "RunConfig object to configure the runtime settings.",
		"warm_start_from":        "A string filepath to a checkpoint to warm-start from, or a 'WarmStartSettings' object to fully configure warm-starting. If the string filepath is provided instead of a 'WarmStartSettings', then all weights are warm-started, and it is assumed that vocabularies and Tensor names are unchanged.",
		"loss_reduction":         "One of 'tf.losses.Reduction' except 'NONE'. Describes how to reduce training loss over batch. Defaults to 'SUM_OVER_BATCH_SIZE'.",
		"batch_norm":             "Whether to use batch normalization after each hidden layer.",
		"linear_sparse_combiner": "A string specifying how to reduce the linear model if a categorical column is multivalent. One of \"mean\", \"sqrtn\", and \"sum\" -- these are effectively different ways to do example-level normalization, which can be useful for bag-of-words features. For more details, see 'tf.feature_column.linear_model'. Raises: ValueError: If both linear_feature_columns and dnn_features_columns are empty at the same time.",
	},
	"xgboost.gbtree": {
		"max_depth":         "int Maximum tree depth for base learners.",
		"learning_rate":     "float Boosting learning rate (xgb's \"eta\")",
		"n_estimators":      "int Number of trees to fit.",
		"verbosity":         "int The degree of verbosity. Valid values are 0 (silent) - 3 (debug).",
		"silent":            "boolean Whether to print messages while running boosting. Deprecated. Use verbosity instead.",
		"objective":         "string or callable Specify the learning task and the corresponding learning objective or a custom objective function to be used (see note below).",
		"nthread":           "int Number of parallel threads used to run xgboost. (Deprecated, please use ''n_jobs'')",
		"n_jobs":            "int Number of parallel threads used to run xgboost. (replaces ''nthread'')",
		"gamma":             "float Minimum loss reduction required to make a further partition on a leaf node of the tree.",
		"min_child_weight":  "int Minimum sum of instance weight(hessian) needed in a child.",
		"max_delta_step":    "int Maximum delta step we allow each tree's weight estimation to be.",
		"subsample":         "float Subsample ratio of the training instance.",
		"colsample_bytree":  "float Subsample ratio of columns when constructing each tree.",
		"colsample_bylevel": "float Subsample ratio of columns for each level.",
		"colsample_bynode":  "float Subsample ratio of columns for each split.",
		"reg_alpha":         "float (xgb's alpha) L1 regularization term on weights",
		"reg_lambda":        "float (xgb's lambda) L2 regularization term on weights",
		"scale_pos_weight":  "float Balancing of positive and negative weights.",
		"base_score":        "float The initial prediction score of all instances, global bias.",
		"seed":              "int Random number seed. (Deprecated, please use random_state)",
		"random_state":      "int Random number seed. (replaces seed)",
		"missing":           "float, optional Value in the data which needs to be present as a missing value. If None, defaults to np.nan.",
		"importance_type":   "string, default \"gain\" The feature importance type for the feature_importances_ property: either \"gain\", \"weight\", \"cover\", \"total_gain\" or \"total_cover\".",
		"max_bin":           "Only used if tree_method is set to hist, Maximum number of discrete bins to bucket continuous features.",
	},
	"xgboost.gblinear": {
		"max_depth":         "int Maximum tree depth for base learners.",
		"learning_rate":     "float Boosting learning rate (xgb's \"eta\")",
		"n_estimators":      "int Number of trees to fit.",
		"verbosity":         "int The degree of verbosity. Valid values are 0 (silent) - 3 (debug).",
		"silent":            "boolean Whether to print messages while running boosting. Deprecated. Use verbosity instead.",
		"objective":         "string or callable Specify the learning task and the corresponding learning objective or a custom objective function to be used (see note below).",
		"nthread":           "int Number of parallel threads used to run xgboost. (Deprecated, please use ''n_jobs'')",
		"n_jobs":            "int Number of parallel threads used to run xgboost. (replaces ''nthread'')",
		"gamma":             "float Minimum loss reduction required to make a further partition on a leaf node of the tree.",
		"min_child_weight":  "int Minimum sum of instance weight(hessian) needed in a child.",
		"max_delta_step":    "int Maximum delta step we allow each tree's weight estimation to be.",
		"subsample":         "float Subsample ratio of the training instance.",
		"colsample_bytree":  "float Subsample ratio of columns when constructing each tree.",
		"colsample_bylevel": "float Subsample ratio of columns for each level.",
		"colsample_bynode":  "float Subsample ratio of columns for each split.",
		"reg_alpha":         "float (xgb's alpha) L1 regularization term on weights",
		"reg_lambda":        "float (xgb's lambda) L2 regularization term on weights",
		"scale_pos_weight":  "float Balancing of positive and negative weights.",
		"base_score":        "float The initial prediction score of all instances, global bias.",
		"seed":              "int Random number seed. (Deprecated, please use random_state)",
		"random_state":      "int Random number seed. (replaces seed)",
		"missing":           "float, optional Value in the data which needs to be present as a missing value. If None, defaults to np.nan.",
		"importance_type":   "string, default \"gain\" The feature importance type for the feature_importances_ property: either \"gain\", \"weight\", \"cover\", \"total_gain\" or \"total_cover\".",
		"max_bin":           "Only used if tree_method is set to hist, Maximum number of discrete bins to bucket continuous features.",
	},
	"xgboost.dart": {
		"max_depth":         "int Maximum tree depth for base learners.",
		"learning_rate":     "float Boosting learning rate (xgb's \"eta\")",
		"n_estimators":      "int Number of trees to fit.",
		"verbosity":         "int The degree of verbosity. Valid values are 0 (silent) - 3 (debug).",
		"silent":            "boolean Whether to print messages while running boosting. Deprecated. Use verbosity instead.",
		"objective":         "string or callable Specify the learning task and the corresponding learning objective or a custom objective function to be used (see note below).",
		"nthread":           "int Number of parallel threads used to run xgboost. (Deprecated, please use ''n_jobs'')",
		"n_jobs":            "int Number of parallel threads used to run xgboost. (replaces ''nthread'')",
		"gamma":             "float Minimum loss reduction required to make a further partition on a leaf node of the tree.",
		"min_child_weight":  "int Minimum sum of instance weight(hessian) needed in a child.",
		"max_delta_step":    "int Maximum delta step we allow each tree's weight estimation to be.",
		"subsample":         "float Subsample ratio of the training instance.",
		"colsample_bytree":  "float Subsample ratio of columns when constructing each tree.",
		"colsample_bylevel": "float Subsample ratio of columns for each level.",
		"colsample_bynode":  "float Subsample ratio of columns for each split.",
		"reg_alpha":         "float (xgb's alpha) L1 regularization term on weights",
		"reg_lambda":        "float (xgb's lambda) L2 regularization term on weights",
		"scale_pos_weight":  "float Balancing of positive and negative weights.",
		"base_score":        "float The initial prediction score of all instances, global bias.",
		"seed":              "int Random number seed. (Deprecated, please use random_state)",
		"random_state":      "int Random number seed. (replaces seed)",
		"missing":           "float, optional Value in the data which needs to be present as a missing value. If None, defaults to np.nan.",
		"importance_type":   "string, default \"gain\" The feature importance type for the feature_importances_ property: either \"gain\", \"weight\", \"cover\", \"total_gain\" or \"total_cover\".",
		"max_bin":           "Only used if tree_method is set to hist, Maximum number of discrete bins to bucket continuous features.",
	},
}

PremadeModelParamsDocs stores parameters and documents of all known models

View Source
var XGBoostObjectiveDocs = map[string]string{
	"binary:hinge":        "hinge loss for binary classification. This makes predictions of 0 or 1, rather than producing probabilities.",
	"binary:logistic":     "logistic regression for binary classification, output probability",
	"binary:logitraw":     "logistic regression for binary classification, output score before logistic transformation",
	"multi:softmax":       "set XGBoost to do multiclass classification using the softmax objective, you also need to set num_class(number of classes)",
	"multi:softprob":      "same as softmax, but output a vector of ndata * nclass, which can be further reshaped to ndata * nclass matrix. The result contains predicted probability of each data point belonging to each class.",
	"rank:map":            "Use LambdaMART to perform list-wise ranking where Mean Average Precision (MAP) is maximized",
	"rank:ndcg":           "Use LambdaMART to perform list-wise ranking where Normalized Discounted Cumulative Gain (NDCG) is maximized",
	"rank:pairwise":       "Use LambdaMART to perform pairwise ranking where the pairwise loss is minimized",
	"reg:gamma":           "gamma regression with log-link. Output is a mean of gamma distribution. It might be useful, e.g., for modeling insurance claims severity, or for any outcome that might be gamma-distributed.",
	"reg:linear":          "linear regression",
	"reg:logistic":        "logistic regression",
	"reg:squarederror":    "regression with squared loss.",
	"reg:squaredlogerror": "regression with squared log loss 1/2[log(pred+1)\u2212log(label+1)]^2",
	"reg:tweedie":         "Tweedie regression with log-link. It might be useful, e.g., for modeling total loss in insurance, or for any outcome that might be Tweedie-distributed.",
	"survival:cox":        "Cox regression for right censored survival time data (negative values are considered right censored). Note that predictions are returned on the hazard ratio scale (i.e., as HR = exp(marginal_prediction) in the proportional hazard function h(t) = h0(t) * HR).",
}

XGBoostObjectiveDocs is xgboost objective parameter docs extracted from https://xgboost.readthedocs.io/en/latest/parameter.html

Functions

func ExtractSQLFlowModelsSymbolOnce

func ExtractSQLFlowModelsSymbolOnce()

ExtractSQLFlowModelsSymbolOnce extracts parameter documents from python doc strings using sync.Once

func ExtractSymbol

func ExtractSymbol(module ...string)

ExtractSymbol extracts parameter documents of Python modules from doc strings

func Float32LowerBoundChecker

func Float32LowerBoundChecker(lower float32, includeLower bool) func(float32) error

Float32LowerBoundChecker returns a range checker that only checks the lower bound.

func Float32RangeChecker

func Float32RangeChecker(lower, upper float32, includeLower, includeUpper bool) func(float32) error

Float32RangeChecker is a helper function to generate range checkers on attributes. lower/upper indicates the lower bound and upper bound of the attribute value. includeLower/includeUpper indicates the inclusion of the bound.

func Float32UpperBoundChecker

func Float32UpperBoundChecker(upper float32, includeUpper bool) func(float32) error

Float32UpperBoundChecker returns a range checker that only checks the upper bound.

func IntChoicesChecker

func IntChoicesChecker(choices ...int) func(int) error

IntChoicesChecker verifies the attribute value is in a list of choices.

func IntLowerBoundChecker

func IntLowerBoundChecker(lower int, includeLower bool) func(int) error

IntLowerBoundChecker returns a range checker that only checks the lower bound.

func IntRangeChecker

func IntRangeChecker(lower, upper int, includeLower, includeUpper bool) func(int) error

IntRangeChecker is a helper function to generate range checkers on attributes. lower/upper indicates the lower bound and upper bound of the attribute value. includeLower/includeUpper indicates the inclusion of the bound.

func IntUpperBoundChecker

func IntUpperBoundChecker(upper int, includeUpper bool) func(int) error

IntUpperBoundChecker returns a range checker that only checks the upper bound.

func StringChoicesChecker

func StringChoicesChecker(choices ...string) func(string) error

StringChoicesChecker verifies the attribute value is in a list of choices.

Types

type Dictionary

type Dictionary map[string]*description

Dictionary contains the description of all attributes

func NewDictionaryFromModelDefinition

func NewDictionaryFromModelDefinition(estimator, prefix string) Dictionary

NewDictionaryFromModelDefinition create a new Dictionary according to pre-made estimators or XGBoost model types.

func (Dictionary) Bool

func (d Dictionary) Bool(name string, value interface{}, doc string, checker func(bool) error) Dictionary

Bool declares an attribute of bool-typed in Dictionary d.

func (Dictionary) ExportDefaults

func (d Dictionary) ExportDefaults(attrs map[string]interface{})

ExportDefaults exports default values defined in Dictionary to attrs.

func (Dictionary) Float

func (d Dictionary) Float(name string, value interface{}, doc string, checker func(float32) error) Dictionary

Float declares an attribute of float32-typed in Dictionary d.

func (Dictionary) GenerateTableInHTML

func (d Dictionary) GenerateTableInHTML() string

GenerateTableInHTML generates the attribute dictionary table in HTML format

func (Dictionary) Int

func (d Dictionary) Int(name string, value interface{}, doc string, checker func(int) error) Dictionary

Int declares an attribute of int-typed in Dictionary d.

func (Dictionary) IntList

func (d Dictionary) IntList(name string, value interface{}, doc string, checker func([]int) error) Dictionary

IntList declares an attribute of []int-typed in Dictionary d.

func (Dictionary) String

func (d Dictionary) String(name string, value interface{}, doc string, checker func(string) error) Dictionary

String declares an attribute of string-typed in Dictionary d.

func (Dictionary) Unknown

func (d Dictionary) Unknown(name string, value interface{}, doc string, checker func(interface{}) error) Dictionary

Unknown declares an attribute of dynamically determined type

func (Dictionary) Update

func (d Dictionary) Update(other Dictionary) Dictionary

Update updates `d` by copying from `other` key by key

func (Dictionary) Validate

func (d Dictionary) Validate(attrs map[string]interface{}) error

Validate validates the attribute based on dictionary. The validation includes

  1. Type checking
  2. Customer checker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL