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

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

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

Key.toString介绍

[英]Converts the key to HTML displayable string. For user keys returns the key itself, for system keys returns their hexadecimal values.
[中]将密钥转换为HTML可显示字符串。对于用户键,返回键本身;对于系统键,返回其十六进制值。

代码示例

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

public static String idForRun(Key<AutoML> runKey) {
 if (null == runKey)
  return "AutoML_Feedback_dummy";
 return "AutoML_Feedback_" + runKey.toString();
}

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

@Override public boolean toHTML(StringBuilder sb) {
 sb.append("<div class=\"alert alert-success\">")
  .append("Model ")
  .append(Inspector.link(model._key.toString(), model._key.toString()))
  .append(" was sucessfuly saved to <b>"+path+"</b> file.");
 sb.append("</div>");
 return true;
}

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

@Override
 public boolean filter(KeySnapshot.KeyInfo k) {
  return Value.isSubclassOf(k._type, DeepWaterImageIterator.IcedImage.class) && k._key.toString().contains(CACHE_MARKER)
  || Value.isSubclassOf(k._type, DeepWaterDatasetIterator.IcedRow.class) && k._key.toString().contains(CACHE_MARKER);
 }
}).keys();

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

private static TreeCoords parseTreeCoords(Key<CompressedTree> ctKey) {
  String key = ctKey.toString();
  int prefixIdx = key.indexOf(KEY_PREFIX);
  if (prefixIdx < 0)
   throw new IllegalStateException("Unexpected structure of a CompressedTree key=" + key);
  String[] keyParts = key.substring(prefixIdx + KEY_PREFIX.length()).split("_", 3);
  TreeCoords tc = new TreeCoords();
  tc._treeId = Integer.valueOf(keyParts[0]);
  tc._clazz = Integer.valueOf(keyParts[1]);
  return tc;
 }
}

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

public KMeans2Model(KMeans2 params, Key selfKey, Key dataKey, String names[], String domains[][]) {
 super(selfKey, dataKey, names, domains, /* priorClassDistribution */ null, /* modelClassDistribution */ null);
 _ncats = params._ncats;
 parameters = params;
 // only for backward-compatibility of JSON response
 k = params.k;
 normalized = params.normalize;
 max_iter = params.max_iter;
 _clustersKey = Key.make(selfKey.toString() + "_clusters");
}

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

public static Key generateShuffledKey(Key mk) {
 String n = mk!=null ? mk.toString() : "noname";
 String suffix = "";
 if (n.endsWith(".hex")) {
  n = n.substring(0, n.length()-4); // be nice
  suffix = ".hex";
 }
 return Key.make(n+"_shuffled"+suffix);
}
public static boolean isSorted(int [] ids){

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

public FileIntegrityChecker(File root) {
 _root = PersistNFS.decodeFile(new File(root.getAbsolutePath())).toString();
 ArrayList<File> filesInProgress = new ArrayList();
 addFolder(root,filesInProgress);
 _files = new String[filesInProgress.size()];
 _sizes = new long[filesInProgress.size()];
 for (int i = 0; i < _files.length; ++i) {
  File f = filesInProgress.get(i);
  _files[i] = f.getAbsolutePath();
  _sizes[i] = f.length();
 }
}

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

private void giveDatasetFeedback(Frame frame, UserFeedback userFeedback, HashMap<String, Object> frameMeta) {
 userFeedback.info(Stage.FeatureAnalysis, "Metadata for Frame: " + frame._key.toString());
 for (Map.Entry<String, Object> entry : frameMeta.entrySet()) {
  if (entry.getKey().startsWith("Dummy"))
   continue;
  Object val = entry.getValue();
  if (val instanceof Double || val instanceof Float)
   userFeedback.info(Stage.FeatureAnalysis, entry.getKey() + ": " + String.format("%.6f", val));
  else
   userFeedback.info(Stage.FeatureAnalysis, entry.getKey() + ": " + entry.getValue());
 }
}

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

public static AutoML getFromDKV(String param_name, Key key) {
  if (key == null)
   throw new H2OIllegalArgumentException(param_name, "AutoML.getFromDKV()", null);

  Value v = DKV.get(key);
  if (v == null)
   throw new H2OKeyNotFoundArgumentException(param_name, key.toString());

  Iced ice = v.get();
  if (! (ice instanceof AutoML))
   throw new H2OKeyWrongTypeArgumentException(param_name, key.toString(), AutoML.class, ice.getClass());

  return (AutoML) ice;
 }
}

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

public static Leaderboard getFromDKV(String param_name, Key key) {
  if (key == null)
   throw new H2OIllegalArgumentException(param_name, "Leaderboard.getFromDKV()", null);

  Value v = DKV.get(key);
  if (v == null)
   throw new H2OKeyNotFoundArgumentException(param_name, key.toString());

  Iced ice = v.get();
  if (! (ice instanceof Leaderboard))
   throw new H2OKeyWrongTypeArgumentException(param_name, key.toString(), Leaderboard.class, ice.getClass());

  return (Leaderboard) ice;
 }
}

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

public void putInDKV() {
 Key metricsKey = this.buildKey();
 Log.debug("Putting ModelMetrics: " + metricsKey.toString());
 DKV.put(metricsKey, this);
}

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

public static ModelMetrics getFromDKV(UniqueId model, UniqueId frame) {
 Key metricsKey = buildKey(model, frame);
 Log.debug("Getting ModelMetrics: " + metricsKey.toString());
 Value v = DKV.get(metricsKey);
 if (null == v)
  return null;
 return (ModelMetrics)v.get();
}

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

public static ModelMetrics getFromDKV(Model model, Frame frame) {
 Key metricsKey = buildKey(model, frame);
 Log.debug("Getting ModelMetrics: " + metricsKey.toString());
 Value v = DKV.get(metricsKey);
 if (null == v)
  return null;
 return (ModelMetrics)v.get();
}

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

/** Return the query link to this page */
 public static String link(Key k, String content) {
  RString rs = new RString("<a href='LR2.query?data_key=%$key'>%content</a>");
  rs.replace("key", k.toString());
  rs.replace("content", content);
  return rs.toString();
 }
}

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

private void toJavaGetNumClustersBody(SBPrintStream body) {
 // This is model name
 final String mname = JCodeGen.toJavaId(_key.toString());
 body.ip("int nclusters = ").pj(mname + "_CENTERS", "VALUES").p(".length;").nl();
}

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

public static String link(String key_param, Key k, String content) {
 RString rs = new RString("<a href='/2/PCAScore.query?%key_param=%$key'>%content</a>");
 rs.replace("key_param", key_param);
 rs.replace("key", k.toString());
 rs.replace("content", content);
 return rs.toString();
}

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

public static String link(Key src_key, String content) {
 RString rs = new RString("<a href='/2/NaiveBayes.query?%key_param=%$key'>%content</a>");
 rs.replace("key_param", "source");
 rs.replace("key", src_key.toString());
 rs.replace("content", content);
 return rs.toString();
}

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

public static String link(Key src_key, String content) {
   RString rs = new RString("<a href='/2/PCA.query?%key_param=%$key'>%content</a>");
   rs.replace("key_param", "source");
   rs.replace("key", src_key.toString());
   rs.replace("content", content);
   return rs.toString();
 }
}

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

Frame groupingIgnoringFordColumn(String foldColumnName, Frame targetEncodingMap, String teColumnName) {
  if (foldColumnName != null) {
    int teColumnIndex = targetEncodingMap.find(teColumnName);
    Frame newTargetEncodingMap = groupByTEColumnAndAggregate(targetEncodingMap, teColumnIndex);
    renameColumn(newTargetEncodingMap,  "sum_numerator", "numerator");
    renameColumn(newTargetEncodingMap,  "sum_denominator", "denominator");
    return newTargetEncodingMap;
  } else {
    Frame targetEncodingMapCopy = targetEncodingMap.deepCopy(Key.make().toString());
    DKV.put(targetEncodingMapCopy);
    return targetEncodingMapCopy;
  }
}

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

public static String link(Key k, String content) {
 NeuralNet req = new NeuralNet();
 RString rs = new RString("<a href='" + req.href() + ".query?%key_param=%$key'>%content</a>");
 rs.replace("key_param", "source");
 rs.replace("key", k.toString());
 rs.replace("content", content);
 return rs.toString();
}

相关文章