Example usage for org.opencv.ml Boost setWeakCount

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

Introduction

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

Prototype

public void setWeakCount(int val) 

Source Link

Usage

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

License:Open Source License

@Override
protected Boost createClassifier() {
    Boost boost = Boost.create();

    //      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();//  www. j  a va  2  s .c o m
        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;
}