Package org.apache.mahout.df

Examples of org.apache.mahout.df.Bagging


    throw new IllegalStateException("Exception caught while loading the data: "
        + StringUtils.stringifyException(e));
    }
    log.info("Data loaded : " + data.size() + " instances");

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


  public void close() throws IOException {
    // prepare the data
    log.debug("partition: " + partition + "numInstances: " + instances.size());
   
    Data data = new Data(getDataset(), instances);
    Bagging bagging = new Bagging(getTreeBuilder(), data);

    TreeID key = new TreeID();

    log.debug("Building " + nbTrees + " trees");
    SingleTreePredictions callback = null;
    int[] predictions = null;
    for (int treeId = 0; treeId < nbTrees; treeId++) {
      log.debug("Building tree N° : " + 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

  protected void cleanup(Context context) throws IOException, InterruptedException {
    // prepare the data
    log.debug("partition: " + partition + "numInstances: " + instances.size());

    Data data = new Data(getDataset(), instances);
    Bagging bagging = new Bagging(getTreeBuilder(), data);

    TreeID key = new TreeID();

    log.debug("Building " + nbTrees + " trees");
    SingleTreePredictions callback = null;
    int[] predictions = null;
    for (int treeId = 0; treeId < nbTrees; treeId++) {
      log.debug("Building tree N° : " + 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

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.