Search in sources :

Example 6 with ConfusionMatrix

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);
    }
}
Also used : ConfusionMatrix(hex.ConfusionMatrix)

Aggregations

ConfusionMatrix (hex.ConfusionMatrix)6 Frame (water.fvec.Frame)2 Vec (water.fvec.Vec)2 VarImp (hex.VarImp)1 DeepLearningParameters (hex.deeplearning.DeepLearningModel.DeepLearningParameters)1 ClassSamplingMethod (hex.deeplearning.DeepLearningModel.DeepLearningParameters.ClassSamplingMethod)1 DistributionFamily (hex.genmodel.utils.DistributionFamily)1 LinkedHashSet (java.util.LinkedHashSet)1 Random (java.util.Random)1 water (water)1 water.api (water.api)1 AUC (water.api.AUC)1 H2OModelBuilderIllegalArgumentException (water.exceptions.H2OModelBuilderIllegalArgumentException)1 Chunk (water.fvec.Chunk)1 NFSFileVec (water.fvec.NFSFileVec)1 NewChunk (water.fvec.NewChunk)1