Interface GradBooster

All Superinterfaces:
Serializable
All Known Implementing Classes:
Dart, GBBase, GBLinear, GBTree

public interface GradBooster extends Serializable
Interface of gradient boosting model.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    loadModel(ModelReader reader, boolean with_pbuffer)
    Loads model from stream.
    float[]
    predict(FVec feat, int ntree_limit)
    Generates predictions for given feature vector.
    int[]
    predictLeaf(FVec feat, int ntree_limit)
    Predicts the leaf index of each tree.
    float
    predictSingle(FVec feat, int ntree_limit)
    Generates a prediction for given feature vector.
    void
    setNumClass(int num_class)
     
  • Method Details

    • setNumClass

      void setNumClass(int num_class)
    • loadModel

      void loadModel(ModelReader reader, boolean with_pbuffer) throws IOException
      Loads model from stream.
      Parameters:
      reader - input stream
      with_pbuffer - whether the incoming data contains pbuffer
      Throws:
      IOException - If an I/O error occurs
    • predict

      float[] predict(FVec feat, int ntree_limit)
      Generates predictions for given feature vector.
      Parameters:
      feat - feature vector
      ntree_limit - limit the number of trees used in prediction
      Returns:
      prediction result
    • predictSingle

      float predictSingle(FVec feat, int ntree_limit)
      Generates a prediction for given feature vector.

      This method only works when the model outputs single value.

      Parameters:
      feat - feature vector
      ntree_limit - limit the number of trees used in prediction
      Returns:
      prediction result
    • predictLeaf

      int[] predictLeaf(FVec feat, int ntree_limit)
      Predicts the leaf index of each tree. This is only valid in gbtree predictor.
      Parameters:
      feat - feature vector
      ntree_limit - limit the number of trees used in prediction
      Returns:
      predicted leaf indexes