org.apache.mahout.classifier.df.node
Class NumericalNode
java.lang.Object
org.apache.mahout.classifier.df.node.Node
org.apache.mahout.classifier.df.node.NumericalNode
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
public class NumericalNode
- extends Node
Represents a node that splits using a numerical attribute
Nested classes/interfaces inherited from class org.apache.mahout.classifier.df.node.Node |
Node.Type |
NumericalNode
public NumericalNode()
NumericalNode
public NumericalNode(int attr,
double split,
Node loChild,
Node hiChild)
classify
public double classify(Instance instance)
- Description copied from class:
Node
- predicts the label for the instance
- Specified by:
classify
in class Node
- Returns:
- -1 if the label cannot be predicted
maxDepth
public long maxDepth()
- Specified by:
maxDepth
in class Node
- Returns:
- the maximum depth of the tree
nbNodes
public long nbNodes()
- Specified by:
nbNodes
in class Node
- Returns:
- the total number of nodes of the tree
getType
protected Node.Type getType()
- Specified by:
getType
in class Node
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
getString
protected String getString()
- Specified by:
getString
in class Node
readFields
public void readFields(DataInput in)
throws IOException
- Throws:
IOException
writeNode
protected void writeNode(DataOutput out)
throws IOException
- Specified by:
writeNode
in class Node
- Throws:
IOException
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.