Package de.jungblut.classification.tree
Class LeafNode
- java.lang.Object
-
- de.jungblut.classification.tree.AbstractTreeNode
-
- de.jungblut.classification.tree.LeafNode
-
- All Implemented Interfaces:
org.apache.hadoop.io.Writable
public final class LeafNode extends AbstractTreeNode
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetType()intpredict(de.jungblut.math.DoubleVector features)voidreadFields(java.io.DataInput in)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.protected voidwriteInternal(java.io.DataOutput out)serialize internal state.-
Methods inherited from class de.jungblut.classification.tree.AbstractTreeNode
read, write
-
-
-
-
Method Detail
-
predict
public int predict(de.jungblut.math.DoubleVector features)
- Specified by:
predictin classAbstractTreeNode- 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 void transformToByteCode(org.objectweb.asm.MethodVisitor visitor, org.objectweb.asm.Label returnLabel)Description copied from class:AbstractTreeNodeTransforms 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.- Specified by:
transformToByteCodein classAbstractTreeNode
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Throws:
java.io.IOException
-
writeInternal
protected void writeInternal(java.io.DataOutput out) throws java.io.IOExceptionDescription copied from class:AbstractTreeNodeserialize internal state.- Specified by:
writeInternalin classAbstractTreeNode- Throws:
java.io.IOException
-
getType
public byte getType()
- Specified by:
getTypein classAbstractTreeNode- Returns:
- the byte id of the type: leaf = 1, numerical = 2; nominal = 3
-
-