water.Key.makeSystem()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(105)

本文整理了Java中water.Key.makeSystem()方法的一些代码示例,展示了Key.makeSystem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.makeSystem()方法的具体详情如下:
包路径:water.Key
类名称:Key
方法名:makeSystem

Key.makeSystem介绍

暂无

代码示例

代码示例来源:origin: h2oai/h2o-3

public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) {
 return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand());
}

代码示例来源:origin: h2oai/h2o-2

private Key defaultTreeKey() {
 return Key.makeSystem("__Tree_"+Key.rand());
}

代码示例来源:origin: h2oai/h2o-2

public static Key buildKey(UniqueId model, UniqueId frame) {
 return Key.makeSystem("modelmetrics_" + model.getId() + "_on_" + frame.getId());
}

代码示例来源:origin: h2oai/h2o-2

public Key buildKey() {
 return Key.makeSystem("modelmetrics_" + this.model.getId() + "_on_" + this.frame.getId());
}

代码示例来源:origin: h2oai/h2o-2

public static Key buildKey(Model model, Frame frame) {
 return Key.makeSystem("modelmetrics_" + model.getUniqueId().getId() + "_on_" + frame.getUniqueId().getId());
}

代码示例来源:origin: h2oai/h2o-2

public static Frame prepareFrame(Frame source, int[] ignored_cols, boolean dropConstantCols, boolean dropNACols) {
 Frame fr = new Frame(Key.makeSystem(Key.make().toString()), source._names.clone(), source.vecs().clone());
 if (ignored_cols != null) fr.remove(ignored_cols);
 final Vec[] vecs =  fr.vecs();

代码示例来源:origin: h2oai/h2o-2

public static Frame prepareFrame(Frame source, Vec [] response, int[] ignored_cols, boolean toEnum, boolean dropConstantCols, boolean dropNACols) {
 Frame fr = new Frame(Key.makeSystem(Key.make().toString()), source._names.clone(), source.vecs().clone());
 if(ignored_cols != null && !Utils.isSorted(ignored_cols))
  Arrays.sort(ignored_cols);

代码示例来源:origin: h2oai/h2o-2

public DeepLearningModel(final Key destKey, final Key jobKey, final Key dataKey, final DataInfo dinfo, final DeepLearning params, final float[] priorDist) {
 super(destKey, dataKey, dinfo._adaptedFrame, priorDist);
 this.jobKey = jobKey;
 this._validationKey = params.validation != null ? params.validation._key : null;
 run_time = 0;
 start_time = System.currentTimeMillis();
 _timeLastScoreEnter = start_time;
 model_info = new DeepLearningModelInfo(params, dinfo);
 actual_best_model_key = Key.makeSystem(Key.make().toString());
 if (params.n_folds != 0) actual_best_model_key = null;
 Object job = UKV.get(jobKey);
 if (job instanceof DeepLearning)
  get_params().state = ((DeepLearning)UKV.get(jobKey)).state; //make the job state consistent
 else
  get_params().state = ((Job.JobHandle)UKV.get(jobKey)).state; //make the job state consistent
 if (!get_params().autoencoder) {
  errors = new Errors[1];
  errors[0] = new Errors();
  errors[0].validation = (params.validation != null);
  errors[0].num_folds = params.n_folds;
 }
 assert(Arrays.equals(_key._kb, destKey._kb));
}

代码示例来源:origin: h2oai/h2o-2

/**
  * Rebalance a frame for load balancing
  * @param fr Input frame
  * @param local whether to only create enough chunks to max out all cores on one node only
  * @return Frame that has potentially more chunks
  */
 private Frame reBalance(final Frame fr, boolean local) {
  int chunks = (int)Math.min( 4 * H2O.NUMCPUS * (local ? 1 : H2O.CLOUD.size()), fr.numRows());
  if (fr.anyVec().nChunks() > chunks && !reproducible) {
   Log.info("Dataset already contains " + fr.anyVec().nChunks() + " chunks. No need to rebalance.");
   return fr;
  } else if (reproducible) {
   Log.warn("Reproducibility enforced - using only 1 thread - can be slow.");
   chunks = 1;
  }
  if (!quiet_mode) Log.info("ReBalancing dataset into (at least) " + chunks + " chunks.");
//      return MRUtils.shuffleAndBalance(fr, chunks, seed, local, shuffle_training_data);
  String snewKey = fr._key != null ? (fr._key.toString() + ".balanced") : Key.rand();
  Key newKey = Key.makeSystem(snewKey);
  RebalanceDataSet rb = new RebalanceDataSet(fr, newKey, chunks);
  H2O.submitTask(rb);
  rb.join();
  return UKV.get(newKey);
 }

代码示例来源:origin: h2oai/h2o-2

DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs);
if(userKeys[i].home())++homeKeys;
systemKeys[i] = Key.makeSystem(Key.rand());
DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedInt(i)),fs);
DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedDouble(i),fs);
if(userKeys[i].home())++homeKeys;
systemKeys[i] = Key.makeSystem(Key.rand());
DKV.put(systemKeys[i], new Value(systemKeys[i], new Utils.IcedDouble(i)),fs);

代码示例来源:origin: h2oai/h2o-2

try {
 for (int i = 0; i < 1e2; ++i) {
  Key k = Key.makeSystem(Key.rand());
  keys.add(k);
  DKV.put(k, new Value(k, new Utils.IcedInt(i)));

代码示例来源:origin: h2oai/h2o-2

@Test
public void testLocalKeySet(){
 Key [] userKeys = new Key[100];
 Key [] systemKeys = new Key[100];
 int homeKeys = 0;
 Futures fs = new Futures();
 try {
  for( int i = 0; i < userKeys.length; ++i ) {
   DKV.put(userKeys[i] = Key.make("key" + i), new Utils.IcedInt(i),fs,true);
   if( userKeys[i].home() ) ++homeKeys;
   DKV.put(systemKeys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true);
  }
  fs.blockForPending();
  Key[] keys = H2O.KeySnapshot.localSnapshot().keys();
  Assert.assertEquals(homeKeys, keys.length);
  for (Key k:keys)
   Assert.assertTrue(k.home());
 } finally {
  for (int i = 0; i < userKeys.length; ++i) {
   DKV.remove(userKeys[i],fs);
   DKV.remove(systemKeys[i],fs);
  }
  fs.blockForPending();
 }
}

代码示例来源:origin: h2oai/h2o-2

@Test
public void testGlobalKeySet(){
 Key keys[] = new Key[100];
 Futures fs = new Futures();
 try {
  for (int i = 0; i < 100; ++i)
   DKV.put(Key.make("key" + i), new Utils.IcedInt(i),fs,true);
  for( int i = 0; i < 100; ++i)
   DKV.put(keys[i] = Key.makeSystem(Key.rand()), new Utils.IcedInt(i),fs,true);
  fs.blockForPending();
  Key[] keys2 = H2O.KeySnapshot.globalSnapshot().keys();
  Assert.assertEquals(100, keys2.length);
 } finally {
  for (int i = 0; i < 100; ++i) {
   DKV.remove(Key.make("key" + i),fs);
   DKV.remove(keys[i],fs);
  }
  fs.blockForPending();
 }
}

代码示例来源:origin: ai.h2o/h2o-algos

public static Key<CompressedTree> makeTreeKey(int treeId, int clazz) {
 return Key.makeSystem("tree_" + treeId + "_" + clazz + "_" + Key.rand());
}

相关文章