Class RegTreeImpl

java.lang.Object
biz.k11i.xgboost.tree.RegTreeImpl
All Implemented Interfaces:
RegTree, Serializable

public class RegTreeImpl extends Object implements RegTree
Regression tree.
See Also:
  • Field Details

  • Constructor Details

    • RegTreeImpl

      public RegTreeImpl()
  • Method Details

    • loadModel

      public void loadModel(ModelReader reader) throws IOException
      Loads model from stream.
      Parameters:
      reader - input stream
      Throws:
      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, 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
    • getNodes

      public RegTreeImpl.Node[] getNodes()
      Specified by:
      getNodes in interface RegTree
      Returns:
      Tree's nodes
    • getStats

      public RegTreeNodeStat[] getStats()
      Specified by:
      getStats in interface RegTree
      Returns:
      Tree's nodes stats