Class GBLinear

    • Field Detail

      • weights

        private float[] weights
    • Constructor Detail

      • GBLinear

        public GBLinear()
    • Method Detail

      • loadModel

        public void loadModel​(PredictorConfiguration config,
                              ModelReader reader,
                              boolean ignored_with_pbuffer)
                       throws java.io.IOException
        Description copied from interface: GradBooster
        Loads model from stream.
        Parameters:
        config - predictor configuration
        reader - input stream
        ignored_with_pbuffer - whether the incoming data contains pbuffer
        Throws:
        java.io.IOException - If an I/O error occurs
      • predict

        public float[] predict​(FVec feat,
                               int ntree_limit,
                               float base_score)
        Description copied from interface: GradBooster
        Generates predictions for given feature vector.
        Parameters:
        feat - feature vector
        ntree_limit - limit the number of trees used in prediction
        base_score - base score to initialize prediction
        Returns:
        prediction result
      • predictSingle

        public float predictSingle​(FVec feat,
                                   int ntree_limit,
                                   float base_score)
        Description copied from interface: GradBooster
        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
        base_score - base score to initialize prediction
        Returns:
        prediction result
      • pred

        float pred​(FVec feat,
                   int gid,
                   float base_score)
      • predictLeaf

        public int[] predictLeaf​(FVec feat,
                                 int ntree_limit)
        Description copied from interface: GradBooster
        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
      • predictLeafPath

        public java.lang.String[] predictLeafPath​(FVec feat,
                                                  int ntree_limit)
        Description copied from interface: GradBooster
        Predicts the path to leaf 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 path to leaves
      • weight

        public float weight​(int fid,
                            int gid)
      • bias

        public float bias​(int gid)
      • getNumFeature

        public int getNumFeature()
      • getNumOutputGroup

        public int getNumOutputGroup()