Module org.elasticsearch.xcore
Class Tree.Builder
java.lang.Object
org.elasticsearch.xpack.core.ml.inference.trainedmodel.tree.Tree.Builder
- Enclosing class:
Tree
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddJunction(int nodeIndex, int featureIndex, boolean isDefaultLeft, double decisionThreshold) Add a decision node.addLeaf(int nodeIndex, double value) Sets the node atnodeIndexto a leaf node.addNode(TreeNode.Builder node) build()setClassificationLabels(List<String> classificationLabels) setFeatureNames(List<String> featureNames) setNodes(List<TreeNode.Builder> nodes) setNodes(TreeNode.Builder... nodes) setRoot(TreeNode.Builder root) setTargetType(TargetType targetType)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setFeatureNames
-
setRoot
-
addNode
-
setNodes
-
setNodes
-
setTargetType
-
setClassificationLabels
-
addJunction
public TreeNode.Builder addJunction(int nodeIndex, int featureIndex, boolean isDefaultLeft, double decisionThreshold) Add a decision node. Space for the child nodes is allocated- Parameters:
nodeIndex- Where to place the node. This is either 0 (root) or an existing child node indexfeatureIndex- The feature index the decision is made onisDefaultLeft- Default left branch if the feature is missingdecisionThreshold- The decision threshold- Returns:
- The created node
-
addLeaf
Sets the node atnodeIndexto a leaf node.- Parameters:
nodeIndex- The index as allocated by a call toaddJunction(int, int, boolean, double)value- The prediction value- Returns:
- this
-
addLeaf
-
build
-