Class NominalNode

  • All Implemented Interfaces:
    org.apache.hadoop.io.Writable

    public final class NominalNode
    extends AbstractTreeNode
    • Constructor Summary

      Constructors 
      Constructor Description
      NominalNode()  
      NominalNode​(int splitAttributeIndex, int numCategories)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte getType()  
      int predict​(de.jungblut.math.DoubleVector features)  
      void readFields​(java.io.DataInput in)  
      void sortInternal()  
      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.
      protected 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
    • Constructor Detail

      • NominalNode

        public NominalNode()
      • NominalNode

        public NominalNode​(int splitAttributeIndex,
                           int numCategories)
    • Method Detail

      • sortInternal

        public void sortInternal()
      • predict

        public int predict​(de.jungblut.math.DoubleVector features)
        Specified by:
        predict in class AbstractTreeNode
        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: AbstractTreeNode
        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.
        Specified by:
        transformToByteCode in class AbstractTreeNode
      • 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.IOException
        Description copied from class: AbstractTreeNode
        serialize internal state.
        Specified by:
        writeInternal in class AbstractTreeNode
        Throws:
        java.io.IOException
      • getType

        public byte getType()
        Specified by:
        getType in class AbstractTreeNode
        Returns:
        the byte id of the type: leaf = 1, numerical = 2; nominal = 3