code: public static double toClassifierPrediction(Vector vector) {
          double max = Double.NEGATIVE_INFINITY;
          int maxIndex = 0;
          for (int i = 0; i < vector.size(); i++) {
              double curr = vector.apply(i);
              if (curr > max) {
                  maxIndex = i;
                  max = curr;
              }
          }
  
          return maxIndex;
      }
docs: This is for the edge case where
  you have a single output layer
  and need to convert the output layer to
  an index
  @param vector the vector to get the classifier prediction for
  @return the prediction for the given vector