Class Hyperparameters.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<Hyperparameters.Builder>
co.elastic.clients.elasticsearch.ml.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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Hyperparameters.BuilderAdvanced configuration option.build()Builds aHyperparameters.final Hyperparameters.BuilderdownsampleFactor(Double value) Advanced configuration option.final Hyperparameters.BuilderAdvanced configuration option.final Hyperparameters.BuilderetaGrowthRatePerTree(Double value) Advanced configuration option.final Hyperparameters.BuilderfeatureBagFraction(Double value) Advanced configuration option.final Hyperparameters.BuilderAdvanced configuration option.final Hyperparameters.BuilderAdvanced configuration option.final Hyperparameters.BuildermaxAttemptsToAddTree(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.final Hyperparameters.BuilderAdvanced configuration option.final Hyperparameters.BuilderAdvanced configuration option.final Hyperparameters.BuilderThe maximum number of folds for the cross-validation procedure.final Hyperparameters.BuildernumSplitsPerFeature(Integer value) Determines the maximum number of splits for every feature that can occur in a decision tree when the tree is trained.protected Hyperparameters.Builderself()final Hyperparameters.BuildersoftTreeDepthLimit(Integer value) Advanced configuration option.final Hyperparameters.BuildersoftTreeDepthTolerance(Double value) Advanced configuration option.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
alpha
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
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
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
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 between0.001and1.API name:
eta -
etaGrowthRatePerTree
Advanced configuration option. Specifies the rate at whichetaincreases for each new tree that is added to the forest. For example, a rate of 1.05 increasesetaby 5% for each extra tree. By default, this value is calculated during hyperparameter optimization. It must be between0.5and2.API name:
eta_growth_rate_per_tree -
featureBagFraction
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
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
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
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
The maximum number of folds for the cross-validation procedure.API name:
num_folds -
numSplitsPerFeature
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
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 thesoft_tree_depth_toleranceto 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
Advanced configuration option. This option controls how quickly the regularized loss increases when the tree depth exceedssoft_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
- Specified by:
selfin classWithJsonObjectBuilderBase<Hyperparameters.Builder>
-
build
Builds aHyperparameters.- Specified by:
buildin interfaceObjectBuilder<Hyperparameters>- Throws:
NullPointerException- if some of the required fields are null.
-