All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hex.tree.isoforextended.ExtendedIsolationForestMojoWriter Maven / Gradle / Ivy

There is a newer version: 3.46.0.6
Show newest version
package hex.tree.isoforextended;

import hex.ModelMojoWriter;
import hex.pca.PCAModel;
import hex.tree.isoforextended.isolationtree.CompressedIsolationTree;
import water.DKV;
import water.MemoryManager;

import java.io.IOException;
import java.nio.ByteBuffer;

public class ExtendedIsolationForestMojoWriter extends ModelMojoWriter {
  @SuppressWarnings("unused")  // Called through reflection in ModelBuildersHandler
  public ExtendedIsolationForestMojoWriter() {}

  public ExtendedIsolationForestMojoWriter(ExtendedIsolationForestModel model) {
    super(model);
  }

  @Override public String mojoVersion() {
    return "1.00";
  }

  @Override
  protected void writeModelData() throws IOException {
    writekv("ntrees", model._output._ntrees);
    writekv("sample_size", model._output._sample_size);
    for (int i = 0; i < model._output._ntrees; i++) {
      CompressedIsolationTree compressedIsolationTree = DKV.getGet(model._output._iTreeKeys[i]);
      writeblob(String.format("trees/t%02d.bin", i), compressedIsolationTree.toBytes());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy