Package de.jungblut.classification.tree
Class AbstractTreeNode
- java.lang.Object
-
- de.jungblut.classification.tree.AbstractTreeNode
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
- Direct Known Subclasses:
LeafNode,NominalNode,NumericalNode
public abstract class AbstractTreeNode extends java.lang.Object implements org.apache.hadoop.io.Writable
-
-
Constructor Summary
Constructors Constructor Description AbstractTreeNode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract bytegetType()abstract intpredict(de.jungblut.math.DoubleVector features)static AbstractTreeNoderead(java.io.DataInput in)abstract voidtransformToByteCode(org.objectweb.asm.MethodVisitor visitor, org.objectweb.asm.Label returnLabel)Transforms this node to byte code, given a visitor that already starts containing the methods and a label that must be jumped to in case of a return.voidwrite(java.io.DataOutput out)protected abstract voidwriteInternal(java.io.DataOutput out)serialize internal state.
-
-
-
Method Detail
-
predict
public abstract int predict(de.jungblut.math.DoubleVector features)
- Returns:
- predicts the index of the outcome, or -1 if not known. In the binary case, 0 and 1 are used to distinguish.
-
transformToByteCode
public abstract void transformToByteCode(org.objectweb.asm.MethodVisitor visitor, org.objectweb.asm.Label returnLabel)Transforms this node to byte code, given a visitor that already starts containing the methods and a label that must be jumped to in case of a return.
-
getType
public abstract byte getType()
- Returns:
- the byte id of the type: leaf = 1, numerical = 2; nominal = 3
-
writeInternal
protected abstract void writeInternal(java.io.DataOutput out) throws java.io.IOExceptionserialize internal state.- Throws:
java.io.IOException
-
write
public final void write(java.io.DataOutput out) throws java.io.IOException- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
java.io.IOException
-
read
public static AbstractTreeNode read(java.io.DataInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-