本文整理了Java中water.fvec.Frame.find()
方法的一些代码示例,展示了Frame.find()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Frame.find()
方法的具体详情如下:
包路径:water.fvec.Frame
类名称:Frame
方法名:find
[英]Finds the first column with a matching name.
[中]查找具有匹配名称的第一列。
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
return fr.find("y");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
return fr.find("y");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
return fr.find("C3");
}
},
代码示例来源:origin: h2oai/h2o-3
private boolean checkAllTEColumnsExistAndAreCategorical(Frame data, String[] columnsToEncode) {
for( String columnName : columnsToEncode) {
int columnIndex = data.find(columnName);
assert columnIndex!=-1 : "Column name `" + columnName + "` was not found in the provided data frame";
if(! data.vec(columnIndex).isCategorical()) return false;
}
return true;
}
代码示例来源:origin: h2oai/h2o-3
Frame calculateAndAppendTEEncoding(Frame fr, Frame encodingMap, String targetColumnName, String appendedColumnName) {
int numeratorIndex = fr.find("numerator");
int denominatorIndex = fr.find("denominator");
double globalMeanForTargetClass = calculatePriorMean(encodingMap); // we can only operate on encodingsMap because `fr` could not have target column at all
Vec zeroVec = Vec.makeZero(fr.numRows());
fr.add(appendedColumnName, zeroVec);
int encodingsColumnIdx = fr.find(appendedColumnName);
new CalcEncodings(numeratorIndex, denominatorIndex, globalMeanForTargetClass, encodingsColumnIdx).doAll( fr);
zeroVec.remove();
return fr;
}
代码示例来源:origin: h2oai/h2o-3
Frame calculateAndAppendBlendedTEEncoding(Frame fr, Frame encodingMap, String targetColumnName, String appendedColumnName) {
int numeratorIndex = fr.find("numerator");
int denominatorIndex = fr.find("denominator");
double globalMeanForTargetClass = calculatePriorMean(encodingMap); // TODO since target column is the same for all categorical columns we are trying to encode we can compute global mean only once.
Log.info("Global mean for blending = " + globalMeanForTargetClass);
Vec zeroVec = Vec.makeZero(fr.numRows());
fr.add(appendedColumnName, zeroVec);
int encodingsColumnIdx = fr.find(appendedColumnName);
new CalcEncodingsWithBlending(numeratorIndex, denominatorIndex, globalMeanForTargetClass, _blendingParams, encodingsColumnIdx).doAll(fr);
zeroVec.remove();
return fr;
}
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("name").remove();
return fr.find("cylinders");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("name").remove();
return fr.find("cylinders");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("CAPSULE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("CAPSULE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("AGE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("AGE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("AGE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("CAPSULE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("ID").remove();
return fr.find("CAPSULE");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("name").remove();
return fr.find("cylinders");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
fr.remove("MonthlyIncome").remove();
return fr.find("SeriousDlqin2yrs");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
protected Frame predictScoreImpl(Frame fr, Frame adaptFrm, String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc) {
int nResponses = 0;
for (String col : _parms.responseCols())
if (adaptFrm.find(col) != -1)
nResponses++;
DataInfo scoringInfo = _output.data_info.scoringInfo(_output._names, adaptFrm, nResponses, false);
return new CoxPHScore(scoringInfo, _output, _parms.isStratified())
.doAll(Vec.T_NUM, scoringInfo._adaptedFrame)
.outputFrame(Key.<Frame>make(destination_key), new String[]{"lp"}, null);
}
代码示例来源:origin: h2oai/h2o-3
@Override
int prep(Frame fr) {
Vec resp = fr.remove("C2");
fr.add("C2", resp.toCategoricalVec());
resp.remove();
return fr.find("C3");
}
},
代码示例来源:origin: h2oai/h2o-3
@Override
protected ModelMetrics.MetricBuilder scoreMetrics(Frame adaptFrm) {
final boolean makeNative = model_info()._backend ==null;
if (makeNative) model_info().javaToNative();
final boolean computeMetrics = (!isSupervised() || (adaptFrm.vec(_output.responseName()) != null && !adaptFrm.vec(_output.responseName()).isBad()));
// Build up the names & domains.
String [] domain = !computeMetrics ? _output._domains[_output._domains.length-1] : adaptFrm.lastVec().domain();
// Score the dataset, building the class distribution & predictions
BigScore bs = new DeepWaterBigScore(domain,0,adaptFrm.means(),_output.hasWeights() && adaptFrm.find(_output.weightsName()) >= 0,computeMetrics, false /*no preds*/, null).doAll(adaptFrm);
if (makeNative) removeNativeState();
return bs._mb;
}
内容来源于网络,如有侵权,请联系作者删除!