InputType - The input type for the tree.InteriorType - The type that is the output of the decision made at
this tree node.public class RegressionTreeNode<InputType,InteriorType> extends AbstractDecisionTreeNode<InputType,java.lang.Double,InteriorType>
RegressionTreeNode implements a DecisionTreeNode for
a tree that does regression.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_VALUE
The default value for the node is 0.0.
|
protected Evaluator<? super InputType,java.lang.Double> |
scalarFunction
The function to apply for leaf nodes.
|
protected double |
value
The value stored at the tree node.
|
childMap, decider, incomingValue, parent| Constructor and Description |
|---|
RegressionTreeNode()
Creates a new instance of RegressionTreeNode.
|
RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent,
Categorizer<? super InputType,? extends InteriorType> decider,
double value)
Creates a new instance of RegressionTreeNode.
|
RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent,
Categorizer<? super InputType,? extends InteriorType> decider,
Evaluator<? super InputType,java.lang.Double> scalarFunction,
double value,
java.lang.Object incomingValue)
Creates a new instance of RegressionTreeNode.
|
RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent,
double value)
Creates a new instance of RegressionTreeNode.
|
RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent,
Evaluator<? super InputType,java.lang.Double> scalarFunction,
double value)
Creates a new instance of RegressionTreeNode.
|
RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent,
Evaluator<? super InputType,java.lang.Double> scalarFunction,
double value,
java.lang.Object incomingValue)
Creates a new instance of RegressionTreeNode.
|
| Modifier and Type | Method and Description |
|---|---|
RegressionTreeNode<InputType,InteriorType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
java.lang.Double |
getOutput(InputType input)
Gets the local output of this node for the given input.
|
Evaluator<? super InputType,java.lang.Double> |
getScalarFunction()
Gets the scalar function applied to the input when the node is a leaf
node.
|
double |
getValue()
Gets the value stored at the node, which is usually the mean value.
|
void |
setScalarFunction(Evaluator<? super InputType,java.lang.Double> scalarFunction)
Sets the scalar function applied to the input when the node is a leaf
node.
|
void |
setValue(double value)
Sets the value stored at the node, which is usually the mean value.
|
addChild, chooseChild, getChildMap, getChildren, getDecider, getDepth, getIncomingValue, getParent, getTreeSize, isLeaf, setChildMap, setDecider, setIncomingValue, setParentpublic static final double DEFAULT_VALUE
protected Evaluator<? super InputType,java.lang.Double> scalarFunction
protected double value
public RegressionTreeNode()
public RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent, double value)
parent - The parent node of this node. Null if this is a root.value - The value stored at the node.public RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent, Categorizer<? super InputType,? extends InteriorType> decider, double value)
parent - The parent node of this node. Null if this is a root.decider - The decision function for interior nodes.value - The value stored at the node.public RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent, Evaluator<? super InputType,java.lang.Double> scalarFunction, double value)
parent - The parent node of this node. Null if this is a root.scalarFunction - The scalar function to apply at leaf nodes.value - The value stored at the node.public RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent, Evaluator<? super InputType,java.lang.Double> scalarFunction, double value, java.lang.Object incomingValue)
parent - The parent node of this node. Null if this is a root.scalarFunction - The scalar function to apply at leaf nodes.value - The value stored at the node.incomingValue - The incoming value.public RegressionTreeNode(DecisionTreeNode<InputType,java.lang.Double> parent, Categorizer<? super InputType,? extends InteriorType> decider, Evaluator<? super InputType,java.lang.Double> scalarFunction, double value, java.lang.Object incomingValue)
parent - The parent node of this node. Null if this is a root.decider - The decision function for interior nodes.scalarFunction - The scalar function to apply at leaf nodes.value - The value stored at the node.incomingValue - The incoming value.public RegressionTreeNode<InputType,InteriorType> clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface CloneableSerializableclone in class AbstractDecisionTreeNode<InputType,java.lang.Double,InteriorType>public java.lang.Double getOutput(InputType input)
DecisionTreeNodeinput - The input.public Evaluator<? super InputType,java.lang.Double> getScalarFunction()
public void setScalarFunction(Evaluator<? super InputType,java.lang.Double> scalarFunction)
scalarFunction - The scalar function applied to the input for leaves.public double getValue()
public void setValue(double value)
value - The value stored at the node.