Class 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
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract byte getType()  
      abstract int predict​(de.jungblut.math.DoubleVector features)  
      static AbstractTreeNode read​(java.io.DataInput in)  
      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.
      void write​(java.io.DataOutput out)  
      protected abstract void writeInternal​(java.io.DataOutput out)
      serialize internal state.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.hadoop.io.Writable

        readFields
    • Constructor Detail

      • AbstractTreeNode

        public AbstractTreeNode()
    • 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.IOException
        serialize internal state.
        Throws:
        java.io.IOException
      • write

        public final void write​(java.io.DataOutput out)
                         throws java.io.IOException
        Specified by:
        write in interface org.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