docs: private void buildModel() {
      DeepLearningModel cp = null;
      if (checkpoint == null) {
        cp = initModel();
        cp.start_training(null);
      } else {
        final DeepLearningModel previous = UKV.get(checkpoint);
        if (previous == null) throw new IllegalArgumentException("Checkpoint not found.");
        Log.info("Resuming from checkpoint.");
        if (n_folds != 0) {
          throw new UnsupportedOperationException("n_folds must be 0: Cross-validation is not supported during checkpoint restarts.");
        }
        else {
          ((ValidatedJob)previous.job()).xval_models = null; //remove existing cross-validation keys after checkpoint restart
        }
        if (source == null || (previous.model_info().get_params().source != null && !Arrays.equals(source._key._kb, previous.model_info().get_params().source._key._kb))) {
          throw new IllegalArgumentException("source must be the same as for the checkpointed model.");
        }
        autoencoder = previous.model_info().get_params().autoencoder;
        if (!autoencoder && (response == null || !source.names()[source.find(response)].equals(previous.responseName()))) {
          throw new IllegalArgumentException("response must be the same as for the checkpointed model.");
        }
  //      if (!autoencoder && (response == null || !Arrays.equals(response._key._kb, previous.model_info().get_params().response._key._kb))) {
  //        throw new IllegalArgumentException("response must be the same as for the checkpointed model.");
  //      }
        if (Utils.difference(ignored_cols, previous.model_info().get_params().ignored_cols).length != 0
                || Utils.difference(previous.model_info().get_params().ignored_cols, ignored_cols).length != 0) {
          ignored_cols = previous.model_info().get_params().ignored_cols;
          Log.warn("Automatically re-using ignored_cols from the checkpointed model.");
        }
        if ((validation == null) == (previous._validationKey != null)
                || (validation != null && validation._key != null && previous._validationKey != null
                && !Arrays.equals(validation._key._kb, previous._validationKey._kb))) {
          throw new IllegalArgumentException("validation must be the same as for the checkpointed model.");
        }
        if (classification != previous.model_info().get_params().classification) {
          Log.warn("Automatically switching to " + ((classification=!classification) ? "classification" : "regression") + " (same as the checkpointed model).");
        }
        epochs += previous.epoch_counter; //add new epochs to existing model
        Log.info("Adding " + String.format("%.3f", previous.epoch_counter) + " epochs from the checkpointed model.");
        try {
          final DataInfo dataInfo = prepareDataInfo();
          cp = new DeepLearningModel(previous, destination_key, job_key, dataInfo);
          cp.write_lock(self());
          cp.start_training(previous);
          assert(state==JobState.RUNNING);
          final DeepLearning A = cp.model_info().get_params();
          Object B = this;
          for (Field fA : A.getClass().getDeclaredFields()) {
            if (Utils.contains(cp_modifiable, fA.getName())) {
              if (!expert_mode && Utils.contains(expert_options, fA.getName())) continue;
              for (Field fB : B.getClass().getDeclaredFields()) {
                if (fA.equals(fB)) {
                  try {
                    if (fB.get(B) == null || fA.get(A) == null || !fA.get(A).toString().equals(fB.get(B).toString())) { // if either of the two parameters is null, skip the toString()
                      if (fA.get(A) == null && fB.get(B) == null) continue; //if both parameters are null, we don't need to do anything
                      Log.info("Applying user-requested modification of '" + fA.getName() + "': " + fA.get(A) + " -> " + fB.get(B));
                      fA.set(A, fB.get(B));
                    }
                  } catch (IllegalAccessException e) {
                    e.printStackTrace();
                  }
                }
              }
            }
          }
          if (A.n_folds != 0) {
            Log.warn("Disabling cross-validation: Not supported when resuming training from a checkpoint.");
            A.n_folds = 0;
          }
          cp.update(self());
        } finally {
          if (cp != null) cp.unlock(self());
        }
      }
      trainModel(cp);
      cp.stop_training();
    }