Package org.apache.mahout.df.node

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


    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).label);
    }
   
    int[] attributes = randomAttributes(rng, selected, m);
   
    // find the best split
View Full Code Here


      partitions.add(partition);

      int nbTrees = Step1Mapper.nbTrees(numMaps, numTrees, partition);

      for (int treeId = 0; treeId < nbTrees; treeId++) {
        Node tree = new Leaf(rng.nextInt(100));

        keys[index] = new TreeID(partition, treeId);
        values[index] = new MapredOutput(tree, nextIntArray(rng, numInstances));

        index++;
View Full Code Here

      for (int tree = 0; tree < nbMapTrees; tree++, treeIndex++) {
        keys[treeIndex] = new TreeID(partition, treeIndex);
        // put the partition in the leaf's label
        // this way we can track the outputs
        trees[treeIndex] = new Leaf(partition);
      }
     
      sizes[partition] = splits[partition].length;
    }
View Full Code Here

    public Node build(Random rng, Data data) {
      for (int index = 0; index < data.size(); index++) {
        assertTrue(expected.contains(data.get(index)));
      }

      return new Leaf(-1);
    }
View Full Code Here

      for (int tree = 0; tree < nbMapTrees; tree++, treeIndex++) {
        keys[treeIndex] = new TreeID(partition, treeIndex);
        // put the partition in the leaf's label
        // this way we can track the outputs
        trees[treeIndex] = new Leaf(partition);
      }

      sizes[partition] = splits[partition].length;
    }
View Full Code Here

    public Node build(Random rng, Data data) {
      for (int index = 0; index < data.size(); index++) {
        assertTrue(expected.contains(data.get(index)));
      }

      return new Leaf(-1);
    }
View Full Code Here

      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

      partitions.add(partition);

      int nbTrees = Step1Mapper.nbTrees(NUM_MAPS, NUM_TREES, partition);

      for (int treeId = 0; treeId < nbTrees; treeId++) {
        Node tree = new Leaf(rng.nextInt(100));

        keys[index] = new TreeID(partition, treeId);
        values[index] = new MapredOutput(tree, nextIntArray(rng, NUM_INSTANCES));

        index++;
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);
   
    // find the best split
View Full Code Here

      partitions.add(partition);

      int nbTrees = Step1Mapper.nbTrees(numMaps, numTrees, partition);

      for (int treeId = 0; treeId < nbTrees; treeId++) {
        Node tree = new Leaf(rng.nextInt(100));

        keys[index] = new TreeID(partition, treeId);
        values[index] = new MapredOutput(tree, nextIntArray(rng, numInstances));

        index++;
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.