Class RegTreeImpl

  • All Implemented Interfaces:
    RegTree, java.io.Serializable

    public class RegTreeImpl
    extends java.lang.Object
    implements RegTree
    Regression tree.
    See Also:
    Serialized Form
    • Constructor Detail

      • RegTreeImpl

        public RegTreeImpl()
    • Method Detail

      • loadModel

        public void loadModel​(ModelReader reader)
                       throws java.io.IOException
        Loads model from stream.
        Parameters:
        reader - input stream
        Throws:
        java.io.IOException - If an I/O error occurs
      • getLeafIndex

        public int getLeafIndex​(FVec feat)
        Retrieves nodes from root to leaf and returns leaf index.
        Specified by:
        getLeafIndex in interface RegTree
        Parameters:
        feat - feature vector
        Returns:
        leaf index
      • getLeafPath

        public void getLeafPath​(FVec feat,
                                java.lang.StringBuilder sb)
        Retrieves nodes from root to leaf and returns path to leaf.
        Specified by:
        getLeafPath in interface RegTree
        Parameters:
        feat - feature vector
        sb - output param, will write path path to leaf into this buffer
      • getLeafValue

        public float getLeafValue​(FVec feat,
                                  int root_id)
        Retrieves nodes from root to leaf and returns leaf value.
        Specified by:
        getLeafValue in interface RegTree
        Parameters:
        feat - feature vector
        root_id - starting root index
        Returns:
        leaf value