public class SplitNode<T extends Output<T>> extends Object implements Node<T>
Node
with a split and two child nodes.Constructor and Description |
---|
SplitNode(double splitValue,
int featureID,
double impurity,
Node<T> greaterThan,
Node<T> lessThanOrEqual)
Constructs a split node with the specified split value, feature id, impurity and child nodes.
|
Modifier and Type | Method and Description |
---|---|
Node<T> |
copy()
Copies the node and it's children.
|
boolean |
equals(Object o) |
int |
getFeatureID()
Gets the feature ID that this node uses for splitting.
|
Node<T> |
getGreaterThan()
The node used if the value is greater than the splitValue.
|
double |
getImpurity()
The impurity score of this node.
|
Node<T> |
getLessThanOrEqual()
The node used if the value is less than or equal to the splitValue.
|
Node<T> |
getNextNode(SparseVector e)
Return the appropriate child node.
|
int |
hashCode() |
boolean |
isLeaf()
Is it a leaf node?
|
double |
splitValue()
The threshold value.
|
String |
toString() |
public SplitNode(double splitValue, int featureID, double impurity, Node<T> greaterThan, Node<T> lessThanOrEqual)
splitValue
- The feature value to split on.featureID
- The feature id number.impurity
- The impurity of this node at training time.greaterThan
- The node to take if the feature value is greater than the split value.lessThanOrEqual
- The node to take if the feature value is less than or equal to the split value.public Node<T> getNextNode(SparseVector e)
getNextNode
in interface Node<T extends Output<T>>
e
- The example to inspect.public boolean isLeaf()
Node
public double getImpurity()
Node
getImpurity
in interface Node<T extends Output<T>>
public Node<T> copy()
Node
public int getFeatureID()
public double splitValue()
public Node<T> getGreaterThan()
public Node<T> getLessThanOrEqual()
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.