本文整理了Java中hex.KeyValue.getValue()
方法的一些代码示例,展示了KeyValue.getValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyValue.getValue()
方法的具体详情如下:
包路径:hex.KeyValue
类名称:KeyValue
方法名:getValue
暂无
代码示例来源:origin: h2oai/h2o-3
Constraints constraints(Frame f) {
if (_monotone_constraints == null || _monotone_constraints.length == 0) {
return null;
}
Constraint[] cs = new Constraint[f.numCols()];
for (KeyValue spec : _monotone_constraints) {
if (spec.getValue() == 0)
continue;
int col = f.find(spec.getKey());
if (col < 0) {
throw new IllegalStateException("Invalid constraint specification, column '" + spec.getKey() + "' doesn't exist.");
}
int direction = spec.getValue() < 0 ? -1 : 1;
cs[col] = new Constraint(direction);
}
return new Constraints(cs);
}
代码示例来源:origin: ai.h2o/h2o-ext-xgboost
Map<String, Integer> monotoneConstraints() {
if (_monotone_constraints == null || _monotone_constraints.length == 0) {
return Collections.emptyMap();
}
Map<String, Integer> constraints = new HashMap<>(_monotone_constraints.length);
for (KeyValue constraint : _monotone_constraints) {
final double val = constraint.getValue();
if (val == 0) {
continue;
}
if (constraints.containsKey(constraint.getKey())) {
throw new IllegalStateException("Duplicate definition of constraint for feature '" + constraint.getKey() + "'.");
}
final int direction = val < 0 ? -1 : 1;
constraints.put(constraint.getKey(), direction);
}
return constraints;
}
代码示例来源:origin: ai.h2o/h2o-algos
Constraints constraints(Frame f) {
if (_monotone_constraints == null || _monotone_constraints.length == 0) {
return null;
}
Constraint[] cs = new Constraint[f.numCols()];
for (KeyValue spec : _monotone_constraints) {
if (spec.getValue() == 0)
continue;
int col = f.find(spec.getKey());
if (col < 0) {
throw new IllegalStateException("Invalid constraint specification, column '" + spec.getKey() + "' doesn't exist.");
}
int direction = spec.getValue() < 0 ? -1 : 1;
cs[col] = new Constraint(direction);
}
return new Constraints(cs);
}
内容来源于网络,如有侵权,请联系作者删除!