Package org.apache.mahout.df

Examples of org.apache.mahout.df.Bagging


  protected void cleanup(Context context) throws IOException, InterruptedException {
    // prepare the data
    log.debug("partition: {} numInstances: {}", partition, instances.size());
   
    Data data = new Data(getDataset(), instances);
    Bagging bagging = new Bagging(getTreeBuilder(), data);
   
    TreeID key = new TreeID();
   
    log.debug("Building {} trees", nbTrees);
    SingleTreePredictions callback = null;
    int[] predictions = null;
    for (int treeId = 0; treeId < nbTrees; treeId++) {
      log.debug("Building tree number : {}", treeId);
      if (isOobEstimate() && !isNoOutput()) {
        callback = new SingleTreePredictions(data.size());
        predictions = callback.getPredictions();
      }
     
      Node tree = bagging.build(treeId, rng, callback);
     
      key.set(partition, firstTreeId + treeId);
     
      if (!isNoOutput()) {
        MapredOutput emOut = new MapredOutput(tree, predictions);
View Full Code Here


   * @param data
   *          training data
   */
  public SequentialBuilder(Random rng, TreeBuilder treeBuilder, Data data) {
    this.rng = rng;
    bagging = new Bagging(treeBuilder, data);
  }
View Full Code Here

   
    log.info("Loading the data...");
    data = loadData(conf, getDataset());
    log.info("Data loaded : {} instances", data.size());
   
    bagging = new Bagging(getTreeBuilder(), data);
  }
View Full Code Here

      throw new IllegalStateException("Exception caught while loading the data: "
                                      + StringUtils.stringifyException(e));
    }
    log.info("Data loaded : {} instances", data.size());
   
    bagging = new Bagging(getTreeBuilder(), data);
  }
View Full Code Here

  public void close() throws IOException {
    // prepare the data
    log.debug("partition: {} numInstances: {}", partition, instances.size());
   
    Data data = new Data(getDataset(), instances);
    Bagging bagging = new Bagging(getTreeBuilder(), data);
   
    TreeID key = new TreeID();
   
    log.debug("Building {} trees", nbTrees);
    SingleTreePredictions callback = null;
    int[] predictions = null;
    for (int treeId = 0; treeId < nbTrees; treeId++) {
      log.debug("Building tree number: {}", treeId);
      if (isOobEstimate() && !isNoOutput()) {
        callback = new SingleTreePredictions(data.size());
        predictions = callback.getPredictions();
      }
     
      Node tree = bagging.build(treeId, rng, callback);
     
      key.set(partition, firstTreeId + treeId);
     
      if (!isNoOutput()) {
        MapredOutput emOut = new MapredOutput(tree, predictions);
View Full Code Here

   
    log.info("Loading the data...");
    data = loadData(conf, getDataset());
    log.info("Data loaded : {} instances", data.size());
   
    bagging = new Bagging(getTreeBuilder(), data);
  }
View Full Code Here

  protected void cleanup(Context context) throws IOException, InterruptedException {
    // prepare the data
    log.debug("partition: {} numInstances: {}", partition, instances.size());
   
    Data data = new Data(getDataset(), instances);
    Bagging bagging = new Bagging(getTreeBuilder(), data);
   
    TreeID key = new TreeID();
   
    log.debug("Building {} trees", nbTrees);
    SingleTreePredictions callback = null;
    int[] predictions = null;
    for (int treeId = 0; treeId < nbTrees; treeId++) {
      log.debug("Building tree number : {}", treeId);
      if (isOobEstimate() && !isNoOutput()) {
        callback = new SingleTreePredictions(data.size());
        predictions = callback.getPredictions();
      }
     
      Node tree = bagging.build(treeId, rng, callback);
     
      key.set(partition, firstTreeId + treeId);
     
      if (!isNoOutput()) {
        MapredOutput emOut = new MapredOutput(tree, predictions);
View Full Code Here

   * @param data
   *          training data
   */
  public SequentialBuilder(Random rng, TreeBuilder treeBuilder, Data data) {
    this.rng = rng;
    bagging = new Bagging(treeBuilder, data);
  }
View Full Code Here

   * @param treeBuilder tree builder
   * @param data training data
   */
  public SequentialBuilder(Random rng, TreeBuilder treeBuilder, Data data) {
    this.rng = rng;
    bagging = new Bagging(treeBuilder, data);
  }
View Full Code Here

    log.info("Loading the data...");
    data = loadData(conf, getDataset());
    log.info("Data loaded : " + data.size() + " instances");

    bagging = new Bagging(getTreeBuilder(), data);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.df.Bagging

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.