Example usage for org.opencv.ml Boost DISCRETE

List of usage examples for org.opencv.ml Boost DISCRETE

Introduction

In this page you can find the example usage for org.opencv.ml Boost DISCRETE.

Prototype

int DISCRETE

To view the source code for org.opencv.ml Boost DISCRETE.

Click Source Link

Usage

From source file:qupath.opencv.classify.BoostClassifier.java

License:Open Source License

@Override
protected Boost createClassifier() {
    Boost boost = Boost.create();/*www.j a v  a2 s  .  co m*/

    //      System.out.println("Type: " + boost.getBoostType());
    //      System.out.println("CV folds: " + boost.getCVFolds());
    //      System.out.println("Var count: " + boost.getVarCount());
    //      System.out.println("Weak count: " + boost.getWeakCount());
    //      System.out.println("Min sample count: " + boost.getMinSampleCount());
    //      System.out.println("Max depth: " + boost.getMaxDepth());

    ParameterList params = getParameterList();
    if (params != null) {
        String type = (String) params.getChoiceParameterValue("boostType");
        type = type.toLowerCase();
        if (type.equals("discrete"))
            boost.setBoostType(Boost.DISCRETE);
        else if (type.equals("real"))
            boost.setBoostType(Boost.REAL);
        else if (type.equals("logit"))
            boost.setBoostType(Boost.LOGIT);
        else if (type.equals("gentle"))
            boost.setBoostType(Boost.GENTLE);
        boost.setWeakCount(params.getIntParameterValue("weakCount"));
        boost.setMaxDepth(params.getIntParameterValue("maxDepth"));
    }
    boost.setWeightTrimRate(0);

    return boost;
}