// Path: Android/lib-Myna/src/main/java/biz/k11i/xgboost/util/FVec.java
// public interface FVec extends Serializable {
//     /**
//      * Gets index-th value.
//      *
//      * @param index index
//      * @return value
//      */
//     double fvalue(int index);
// 
//     class Transformer {
//         private Transformer() {
//             // do nothing
//         }
// 
//         /**
//          * Builds FVec from dense vector.
//          *
//          * @param values         float values
//          * @param treatsZeroAsNA treat zero as N/A if true
//          * @return FVec
//          */
//         public static FVec fromArray(float[] values, boolean treatsZeroAsNA) {
//             return new FVecArrayImpl.FVecFloatArrayImpl(values, treatsZeroAsNA);
//         }
// 
//         /**
//          * Builds FVec from dense vector.
//          *
//          * @param values         double values
//          * @param treatsZeroAsNA treat zero as N/A if true
//          * @return FVec
//          */
//         public static FVec fromArray(double[] values, boolean treatsZeroAsNA) {
//             return new FVecArrayImpl.FVecDoubleArrayImpl(values, treatsZeroAsNA);
//         }
// 
//         /**
//          * Builds FVec from map.
//          *
//          * @param map map containing non-zero values
//          * @return FVec
//          */
//         public static FVec fromMap(Map<Integer, ? extends Number> map) {
//             return new FVecMapImpl(map);
//         }
//     }
// }


import biz.k11i.xgboost.util.FVec;
import biz.k11i.xgboost.util.ModelReader;
import java.io.IOException;
import java.io.Serializable;
package biz.k11i.xgboost.gbm;



/**
 * Interface of gradient boosting model.
 */
public interface GradBooster extends Serializable {
    class Factory {
        /**
         * Creates a gradient booster from given name.
         *
         * @param name name of gradient booster
         * @return created gradient booster
         */
        public static GradBooster createGradBooster(String name) {
            if ("gbtree".equals(name)) {
                return new GBTree();
            } else if ("gblinear".equals(name)) {
                return new GBLinear();
            }

            throw new IllegalArgumentException(name + " is not supported model.");
        }
    }

    void setNumClass(int num_class);

    /**
     * Loads model from stream.
     *
     * @param reader       input stream
     * @param with_pbuffer whether the incoming data contains pbuffer
     * @throws IOException If an I/O error occurs
     */
    void loadModel(ModelReader reader, boolean with_pbuffer) throws IOException;

    /**
     * Generates predictions for given feature vector.
     *
     * @param feat        feature vector
     * @param ntree_limit limit the number of trees used in prediction
     * @return prediction result
     */
// Path: Android/lib-Myna/src/main/java/biz/k11i/xgboost/util/FVec.java
// public interface FVec extends Serializable {
//     /**
//      * Gets index-th value.
//      *
//      * @param index index
//      * @return value
//      */
//     double fvalue(int index);
// 
//     class Transformer {
//         private Transformer() {
//             // do nothing
//         }
// 
//         /**
//          * Builds FVec from dense vector.
//          *
//          * @param values         float values
//          * @param treatsZeroAsNA treat zero as N/A if true
//          * @return FVec
//          */
//         public static FVec fromArray(float[] values, boolean treatsZeroAsNA) {
//             return new FVecArrayImpl.FVecFloatArrayImpl(values, treatsZeroAsNA);
//         }
// 
//         /**
//          * Builds FVec from dense vector.
//          *
//          * @param values         double values
//          * @param treatsZeroAsNA treat zero as N/A if true
//          * @return FVec
//          */
//         public static FVec fromArray(double[] values, boolean treatsZeroAsNA) {
//             return new FVecArrayImpl.FVecDoubleArrayImpl(values, treatsZeroAsNA);
//         }
// 
//         /**
//          * Builds FVec from map.
//          *
//          * @param map map containing non-zero values
//          * @return FVec
//          */
//         public static FVec fromMap(Map<Integer, ? extends Number> map) {
//             return new FVecMapImpl(map);
//         }
//     }
// }


// Path: Android/lib-Myna/src/main/java/biz/k11i/xgboost/gbm/GradBooster.java
import biz.k11i.xgboost.util.FVec;
import biz.k11i.xgboost.util.ModelReader;
import java.io.IOException;
import java.io.Serializable;

package biz.k11i.xgboost.gbm;



/**
 * Interface of gradient boosting model.
 */
public interface GradBooster extends Serializable {
    class Factory {
        /**
         * Creates a gradient booster from given name.
         *
         * @param name name of gradient booster
         * @return created gradient booster
         */
        public static GradBooster createGradBooster(String name) {
            if ("gbtree".equals(name)) {
                return new GBTree();
            } else if ("gblinear".equals(name)) {
                return new GBLinear();
            }

            throw new IllegalArgumentException(name + " is not supported model.");
        }
    }

    void setNumClass(int num_class);

    /**
     * Loads model from stream.
     *
     * @param reader       input stream
     * @param with_pbuffer whether the incoming data contains pbuffer
     * @throws IOException If an I/O error occurs
     */
    void loadModel(ModelReader reader, boolean with_pbuffer) throws IOException;

    /**
     * Generates predictions for given feature vector.
     *
     * @param feat        feature vector
     * @param ntree_limit limit the number of trees used in prediction
     * @return prediction result
     */
    double[] predict(FVec feat, int ntree_limit);