private ModelMetrics makeModelMetrics(SharedTreeModel model, Frame fr, Frame adaptedFr, Frame preds) {
    ModelMetrics mm;
    if (model._output.nclasses() == 2 && _computeGainsLift) {
      assert preds != null : "Predictions were pre-created";
      mm = _mb.makeModelMetrics(model, fr, adaptedFr, preds);
    } else {
      boolean calculatePreds = preds == null && model._parms._distribution == DistributionFamily.huber;
      // FIXME: PUBDEV-4992 we should avoid doing full scoring!
      if (calculatePreds) {
        Log.warn("Going to calculate predictions from scratch. This can be expensive for large models! See PUBDEV-4992");
        preds = model.score(fr);
      }
      mm = _mb.makeModelMetrics(model, fr, null, preds);
      if (calculatePreds && (preds != null))
        preds.remove();
    }
    return mm;
  }
private ModelMetrics makeModelMetrics ( SharedTreeModel model , Frame fr , Frame adaptedFr , Frame preds ) { ModelMetrics mm ; if ( model . _output . nclasses ( ) == 2 && _computeGainsLift ) { assert preds != null : "Predictions were pre-created" ; mm = _mb . makeModelMetrics ( model , fr , adaptedFr , preds ) ; } else { boolean calculatePreds = preds == null && model . _parms . _distribution == DistributionFamily . huber ; if ( calculatePreds ) { Log . warn ( "Going to calculate predictions from scratch. This can be expensive for large models! See PUBDEV-4992" ) ; preds = model . score ( fr ) ; } mm = _mb . makeModelMetrics ( model , fr , null , preds ) ; if ( calculatePreds && ( preds != null ) ) preds . remove ( ) ; } return mm ; }
Run after the doAll scoring to convert the MetricsBuilder to a ModelMetrics