Class Hyperparameters.Builder

All Implemented Interfaces:
WithJson<Hyperparameters.Builder>, ObjectBuilder<Hyperparameters>
Enclosing class:
Hyperparameters

public static class Hyperparameters.Builder extends WithJsonObjectBuilderBase<Hyperparameters.Builder> implements ObjectBuilder<Hyperparameters>
Builder for Hyperparameters.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • alpha

      public final Hyperparameters.Builder alpha(@Nullable Double value)
      Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This parameter affects loss calculations by acting as a multiplier of the tree depth. Higher alpha values result in shallower trees and faster training times. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to zero.

      API name: alpha

    • lambda

      public final Hyperparameters.Builder lambda(@Nullable Double value)
      Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies an L2 regularization term which applies to leaf weights of the individual trees in the forest. A high lambda value causes training to favor small leaf weights. This behavior makes the prediction function smoother at the expense of potentially not being able to capture relevant relationships between the features and the dependent variable. A small lambda value results in large individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

      API name: lambda

    • gamma

      public final Hyperparameters.Builder gamma(@Nullable Double value)
      Advanced configuration option. Regularization parameter to prevent overfitting on the training data set. Multiplies a linear penalty associated with the size of individual trees in the forest. A high gamma value causes training to prefer small trees. A small gamma value results in larger individual trees and slower training. By default, this value is calculated during hyperparameter optimization. It must be a nonnegative value.

      API name: gamma

    • eta

      public final Hyperparameters.Builder eta(@Nullable Double value)
      Advanced configuration option. The shrinkage applied to the weights. Smaller values result in larger forests which have a better generalization error. However, larger forests cause slower training. By default, this value is calculated during hyperparameter optimization. It must be a value between 0.001 and 1.

      API name: eta

    • etaGrowthRatePerTree

      public final Hyperparameters.Builder etaGrowthRatePerTree(@Nullable Double value)
      Advanced configuration option. Specifies the rate at which eta increases for each new tree that is added to the forest. For example, a rate of 1.05 increases eta by 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between 0.5 and 2.

      API name: eta_growth_rate_per_tree

    • featureBagFraction

      public final Hyperparameters.Builder featureBagFraction(@Nullable Double value)
      Advanced configuration option. Defines the fraction of features that will be used when selecting a random bag for each candidate split. By default, this value is calculated during hyperparameter optimization.

      API name: feature_bag_fraction

    • downsampleFactor

      public final Hyperparameters.Builder downsampleFactor(@Nullable Double value)
      Advanced configuration option. Controls the fraction of data that is used to compute the derivatives of the loss function for tree training. A small value results in the use of a small fraction of the data. If this value is set to be less than 1, accuracy typically improves. However, too small a value may result in poor convergence for the ensemble and so require more trees. By default, this value is calculated during hyperparameter optimization. It must be greater than zero and less than or equal to 1.

      API name: downsample_factor

    • maxAttemptsToAddTree

      public final Hyperparameters.Builder maxAttemptsToAddTree(@Nullable Integer value)
      If the algorithm fails to determine a non-trivial tree (more than a single leaf), this parameter determines how many of such consecutive failures are tolerated. Once the number of attempts exceeds the threshold, the forest training stops.

      API name: max_attempts_to_add_tree

    • maxOptimizationRoundsPerHyperparameter

      public final Hyperparameters.Builder maxOptimizationRoundsPerHyperparameter(@Nullable Integer value)
      Advanced configuration option. A multiplier responsible for determining the maximum number of hyperparameter optimization steps in the Bayesian optimization procedure. The maximum number of steps is determined based on the number of undefined hyperparameters times the maximum optimization rounds per hyperparameter. By default, this value is calculated during hyperparameter optimization.

      API name: max_optimization_rounds_per_hyperparameter

    • maxTrees

      public final Hyperparameters.Builder maxTrees(@Nullable Integer value)
      Advanced configuration option. Defines the maximum number of decision trees in the forest. The maximum value is 2000. By default, this value is calculated during hyperparameter optimization.

      API name: max_trees

    • numFolds

      public final Hyperparameters.Builder numFolds(@Nullable Integer value)
      The maximum number of folds for the cross-validation procedure.

      API name: num_folds

    • numSplitsPerFeature

      public final Hyperparameters.Builder numSplitsPerFeature(@Nullable Integer value)
      Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.

      API name: num_splits_per_feature

    • softTreeDepthLimit

      public final Hyperparameters.Builder softTreeDepthLimit(@Nullable Integer value)
      Advanced configuration option. Machine learning uses loss guided tree growing, which means that the decision trees grow where the regularized loss decreases most quickly. This soft limit combines with the soft_tree_depth_tolerance to penalize trees that exceed the specified depth; the regularized loss increases quickly beyond this depth. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.

      API name: soft_tree_depth_limit

    • softTreeDepthTolerance

      public final Hyperparameters.Builder softTreeDepthTolerance(@Nullable Double value)
      Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceeds soft_tree_depth_limit. By default, this value is calculated during hyperparameter optimization. It must be greater than or equal to 0.01.

      API name: soft_tree_depth_tolerance

    • self

      protected Hyperparameters.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<Hyperparameters.Builder>
    • build

      public Hyperparameters build()
      Builds a Hyperparameters.
      Specified by:
      build in interface ObjectBuilder<Hyperparameters>
      Throws:
      NullPointerException - if some of the required fields are null.