本文整理了Java中water.fvec.Frame.update()
方法的一些代码示例,展示了Frame.update()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.update()
方法的具体详情如下:
包路径:water.fvec.Frame
类名称:Frame
方法名:update
暂无
代码示例来源:origin: h2oai/h2o-2
@Override
public void onCompletion(CountedCompleter caller) {
_target.update(_job);
_target.unlock(_job);
}
代码示例来源:origin: h2oai/h2o-2
@Override public void onCompletion(CountedCompleter caller){
_out.update(_job);
_out.unlock(_job);
}
代码示例来源:origin: h2oai/h2o-2
@Override public void onCompletion(CountedCompleter caller){
assert _out.numRows() == _in.numRows();
_out.update(_jobKey);
_out.unlock(_jobKey);
}
@Override public boolean onExceptionalCompletion(Throwable t, CountedCompleter caller){
代码示例来源:origin: h2oai/h2o-2
public static Key make(FileStatus f, Futures fs) {
long size = f.getLen();
String fname = f.getPath().toString();
Key k = Key.make(fname);
Key k2 = Vec.newKey(k);
new Frame(k).delete_and_lock(null);
// Insert the top-level FileVec key into the store
Vec v = new HdfsFileVec(k2,size);
DKV.put(k2, v, fs);
Frame fr = new Frame(k,new String[]{fname},new Vec[]{v});
fr.update(null);
fr.unlock(null);
return k;
}
private HdfsFileVec(Key key, long len) {super(key,len,Value.HDFS);}
代码示例来源:origin: h2oai/h2o-2
@Override public void onCompletion(CountedCompleter caller) {
boolean exceptional = workersExceptions!=null;
dataset.unlock(jobKey);
if (splits!=null) {
for (Frame s : splits) {
if (s!=null) {
if (!exceptional) {
s.update(jobKey);
s.unlock(jobKey);
} else { // Have to unlock and delete here
s.unlock(jobKey);
s.delete(jobKey, 3.14f); // delete all splits
}
}
}
}
}
代码示例来源:origin: h2oai/h2o-2
@Override public void onCompletion(CountedCompleter caller) {
boolean exceptional = workersExceptions!=null;
dataset.unlock(jobKey);
if (splits!=null) {
for (Frame s : splits) {
if (s!=null) {
if (!exceptional) {
s.update(jobKey);
s.unlock(jobKey);
} else { // Have to unlock and delete here
s.unlock(jobKey);
s.delete(jobKey, 3.14f); // delete all splits
}
}
}
}
}
代码示例来源:origin: h2oai/h2o-2
NFSFileVec nfs = DKV.get(NFSFileVec.make(f, fs)).get();
Frame fr = new Frame(k,new String[] { "0" }, new Vec[] { nfs });
fr.update(null);
fr.unlock(null);
代码示例来源:origin: h2oai/h2o-2
public static Key make(String serverUri, ClientFileInfo tf, Futures fs) {
String fname = tf.getPath(); // Always return absolute path /dir/filename
long size = tf.getLength();
Key k = Key.make(PersistTachyon.PREFIX + serverUri + fname);
Key k2 = Vec.newKey(k);
new Frame(k).delete_and_lock(null);
// Insert the top-level FileVec key into the store
Vec v = new TachyonFileVec(k2,size);
DKV.put(k2, v, fs);
Frame fr = new Frame(k,new String[] {fname}, new Vec[] {v});
fr.update(null);
fr.unlock(null);
return k;
}
private TachyonFileVec(Key key, long len) {super(key,len,Value.TACHYON);}
代码示例来源:origin: h2oai/h2o-2
public static Key make(S3ObjectSummary obj, Futures fs) {
String fname = obj.getKey();
Key k = Key.make("s3://" + obj.getBucketName() + "/" + fname);
long size = obj.getSize();
Key k2 = Vec.newKey(k);
new Frame(k).delete_and_lock(null);
// Insert the top-level FileVec key into the store
Vec v = new S3FileVec(k2,size);
DKV.put(k2, v, fs);
Frame fr = new Frame(k,new String[]{fname},new Vec[]{v});
fr.update(null);
fr.unlock(null);
return k;
}
private S3FileVec(Key key, long len) {super(key,len,Value.S3);}
代码示例来源:origin: h2oai/h2o-3
@Override
protected Frame postProcessPredictions(Frame adaptedFrame, Frame predictFr, Job j) {
if (_output._calib_model == null)
return predictFr;
if (_output.getModelCategory() == Binomial) {
Key<Job> jobKey = j != null ? j._key : null;
Key<Frame> calibInputKey = Key.make();
Frame calibOutput = null;
try {
Frame calibInput = new Frame(calibInputKey, new String[]{"p"}, new Vec[]{predictFr.vec(1)});
calibOutput = _output._calib_model.score(calibInput);
assert calibOutput._names.length == 3;
Vec[] calPredictions = calibOutput.remove(new int[]{1, 2});
// append calibrated probabilities to the prediction frame
predictFr.write_lock(jobKey);
for (int i = 0; i < calPredictions.length; i++)
predictFr.add("cal_" + predictFr.name(1 + i), calPredictions[i]);
return predictFr.update(jobKey);
} finally {
predictFr.unlock(jobKey);
DKV.remove(calibInputKey);
if (calibOutput != null)
calibOutput.remove();
}
} else
throw H2O.unimpl("Calibration is only supported for binomial models");
}
代码示例来源:origin: h2oai/h2o-3
oldFrame.update(_job);
oldFrame.unlock(_job);
代码示例来源:origin: ai.h2o/h2o-algos
@Override
protected Frame postProcessPredictions(Frame adaptedFrame, Frame predictFr, Job j) {
if (_output._calib_model == null)
return predictFr;
if (_output.getModelCategory() == Binomial) {
Key<Job> jobKey = j != null ? j._key : null;
Key<Frame> calibInputKey = Key.make();
Frame calibOutput = null;
try {
Frame calibInput = new Frame(calibInputKey, new String[]{"p"}, new Vec[]{predictFr.vec(1)});
calibOutput = _output._calib_model.score(calibInput);
assert calibOutput._names.length == 3;
Vec[] calPredictions = calibOutput.remove(new int[]{1, 2});
// append calibrated probabilities to the prediction frame
predictFr.write_lock(jobKey);
for (int i = 0; i < calPredictions.length; i++)
predictFr.add("cal_" + predictFr.name(1 + i), calPredictions[i]);
return predictFr.update(jobKey);
} finally {
predictFr.unlock(jobKey);
DKV.remove(calibInputKey);
if (calibOutput != null)
calibOutput.remove();
}
} else
throw H2O.unimpl("Calibration is only supported for binomial models");
}
代码示例来源:origin: ai.h2o/h2o-algos
oldFrame.update(_job);
oldFrame.unlock(_job);
内容来源于网络,如有侵权,请联系作者删除!