public class TreeNode extends Object implements IgniteModel<Vector,Double>
Modifier and Type | Class and Description |
---|---|
static class |
TreeNode.Type
Type of node.
|
Constructor and Description |
---|
TreeNode(long id,
int treeId)
Create an instance of TreeNode.
|
Modifier and Type | Method and Description |
---|---|
int |
getDepth() |
int |
getFeatureId() |
NodeId |
getId() |
double |
getImpurity() |
TreeNode |
getLeft() |
TreeNode |
getRight() |
TreeNode.Type |
getType() |
double |
getVal() |
Double |
predict(Vector features)
Make a prediction for the specified input arguments.
|
NodeId |
predictNextNodeKey(Vector features)
Returns leaf node for feature vector in according to decision tree.
|
void |
setImpurity(double impurity) |
void |
setVal(double val) |
List<TreeNode> |
toConditional(int featureId,
double val)
Convert node to conditional node.
|
void |
toLeaf(double val)
Convert node to leaf.
|
public TreeNode(long id, int treeId)
id
- Id in according to breadth-first search ordering.treeId
- Tree id.public NodeId predictNextNodeKey(Vector features)
features
- Features.public List<TreeNode> toConditional(int featureId, double val)
featureId
- Feature id.val
- Value.public void toLeaf(double val)
val
- Value.public NodeId getId()
public void setVal(double val)
public TreeNode.Type getType()
public double getVal()
public void setImpurity(double impurity)
public double getImpurity()
public int getDepth()
public int getFeatureId()
public TreeNode getLeft()
public TreeNode getRight()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020