Class LeafNode<T extends Output<T>>
java.lang.Object
org.tribuo.common.tree.LeafNode<T>
- All Implemented Interfaces:
Serializable
,Node<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies the node and it's children.Gets the distribution over scores in this node.double
The impurity score of this node.Returns the next node in the tree based on the supplied example, or null if it's a leaf.Gets the output in this node.getPrediction
(int numUsed, Example<T> example) Constructs a new prediction object based on this node's scores.boolean
isLeaf()
Is it a leaf node?toString()
-
Constructor Details
-
LeafNode
Constructs a leaf node.- Parameters:
impurity
- The impurity value calculated at training time.output
- The output value from this node.scores
- The score map for the other outputs.generatesProbabilities
- If the scores are probabilities.
-
-
Method Details
-
getNextNode
-
isLeaf
-
getImpurity
-
copy
-
getOutput
-
getDistribution
Gets the distribution over scores in this node.- Returns:
- The score distribution.
-
getPrediction
Constructs a new prediction object based on this node's scores.- Parameters:
numUsed
- The number of features used.example
- The example to be scored.- Returns:
- The prediction for the supplied example.
-
toString
-