Package org.apache.mahout.df.node

Examples of org.apache.mahout.df.node.Leaf


      for (int index = 0; index < nbMapTrees; index++, treeIndex++) {
        keys[treeIndex] = new TreeID(partition, treeIndex);

        // put the tree index in the leaf's label
        // this way we can check the stored data
        trees[treeIndex] = new Leaf(treeIndex);
      }
    }
  }
View Full Code Here


    if (selected == null) {
      selected = new boolean[data.getDataset().nbAttributes()];
    }
   
    if (data.isEmpty()) {
      return new Leaf(-1);
    }
    if (isIdentical(data)) {
      return new Leaf(data.majorityLabel(rng));
    }
    if (data.identicalLabel()) {
      return new Leaf(data.get(0).getLabel());
    }
   
    int[] attributes = randomAttributes(rng, selected, m);
    if (attributes == null || attributes.length == 0) {
      // we tried all the attributes and could not split the data anymore
      return new Leaf(data.majorityLabel(rng));
    }

    // find the best split
    Split best = null;
    for (int attr : attributes) {
View Full Code Here

TOP

Related Classes of org.apache.mahout.df.node.Leaf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.