code: final void doScoring(Frame _train, Frame _trainOrig, Frame _valid, Frame _validOrig) {
      ModelMetrics mm = makeMetrics(_train, _trainOrig, true, "Metrics reported on training frame");
      _output._training_metrics = mm;
      _output._scored_train[_output._ntrees].fillFrom(mm);
      addModelMetrics(mm);
      // Optional validation part
      if (_valid!=null) {
        mm = makeMetrics(_valid, _validOrig, false, "Metrics reported on validation frame");
        _output._validation_metrics = mm;
        _output._scored_valid[_output._ntrees].fillFrom(mm);
        addModelMetrics(mm);
      }
    }
docs: Score an XGBoost model on training and validation data (optional)
  Note: every row is scored, all observation weights are assumed to be equal
  @param _train training data in the form of matrix
  @param _valid validation data (optional, can be null)