Example usage for org.apache.mahout.classifier.df.node Node nbNodes

List of usage examples for org.apache.mahout.classifier.df.node Node nbNodes

Introduction

In this page you can find the example usage for org.apache.mahout.classifier.df.node Node nbNodes.

Prototype

public abstract long nbNodes();

Source Link

Usage

From source file:com.wsc.myexample.decisionForest.MyDecisionForest.java

License:Apache License

/**
 * @return Mean number of nodes per tree
 *///  ww w  .j av  a 2s  .  c  om
public long meanNbNodes() {
    long sum = 0;

    for (Node tree : trees) {
        sum += tree.nbNodes();
    }

    return sum / trees.size();
}

From source file:com.wsc.myexample.decisionForest.MyDecisionForest.java

License:Apache License

/**
 * @return Total number of nodes in all the trees
 *//* ww w.j  av a 2 s  .  c  o m*/
public long nbNodes() {
    long sum = 0;

    for (Node tree : trees) {
        sum += tree.nbNodes();
    }

    return sum;
}