code: protected M deepClone(Key<M> result) {
      M newModel = IcedUtils.deepCopy(self());
      newModel._key = result;
      // Do not clone model metrics
      newModel._output.clearModelMetrics();
      newModel._output._training_metrics = null;
      newModel._output._validation_metrics = null;
      // Clone trees
      Key[][] treeKeys = newModel._output._treeKeys;
      for (int i = 0; i < treeKeys.length; i++) {
        for (int j = 0; j < treeKeys[i].length; j++) {
          if (treeKeys[i][j] == null) continue;
          CompressedTree ct = DKV.get(treeKeys[i][j]).get();
          CompressedTree newCt = IcedUtils.deepCopy(ct);
          newCt._key = CompressedTree.makeTreeKey(i, j);
          DKV.put(treeKeys[i][j] = newCt._key,newCt);
        }
      }
      // Clone Aux info
      Key[][] treeKeysAux = newModel._output._treeKeysAux;
      if (treeKeysAux!=null) {
        for (int i = 0; i < treeKeysAux.length; i++) {
          for (int j = 0; j < treeKeysAux[i].length; j++) {
            if (treeKeysAux[i][j] == null) continue;
            CompressedTree ct = DKV.get(treeKeysAux[i][j]).get();
            CompressedTree newCt = IcedUtils.deepCopy(ct);
            newCt._key = Key.make(createAuxKey(treeKeys[i][j].toString()));
            DKV.put(treeKeysAux[i][j] = newCt._key,newCt);
          }
        }
      }
      return newModel;
    }
docs: Performs deep clone of given model.