use of hex.ConfusionMatrix in project h2o-2 by h2oai.
the class SpeeDRFModel method scoreOnTrain.
private void scoreOnTrain(Frame fr, Vec modelResp) {
final CMTask cmTask = CMTask.scoreTask(this, treeCount(), oobee, fr, modelResp);
if (regression) {
float mse = cmTask._ss / ((float) (cmTask._rowcnt));
errs[errs.length - 1] = mse;
cms[cms.length - 1] = null;
} else {
confusion = CMTask.CMFinal.make(cmTask._matrix, this, classNames(), cmTask._errorsPerTree, oobee, cmTask._sum, cmTask._cms);
this.cm = cmTask._matrix._matrix;
errorsPerTree = cmTask._errorsPerTree;
errs[errs.length - 1] = confusion.mse();
cms[cms.length - 1] = new ConfusionMatrix(confusion._matrix);
if (classes() == 2)
validAUC = makeAUC(toCMArray(confusion._cms), ModelUtils.DEFAULT_THRESHOLDS, cmDomain);
}
}
Aggregations