Class LeafNode<T extends Output<T>>
java.lang.Object
org.tribuo.common.tree.LeafNode<T>
- All Implemented Interfaces:
Serializable
,Node<T>
An immutable leaf
Node
that can create a prediction.
equals(java.lang.Object)
uses the Output.fullEquals(Output)
method
to determine equality of two leaves.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies the node and it's children.boolean
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.int
hashCode()
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
-
equals
-
hashCode
-
getNextNode
-
isLeaf
-
getImpurity
-
copy
-
getOutput
-
getDistribution
-
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
-