code: public static double[][] toFeatureVector(Iterable<? extends MLRecord> data,
              List<MLFeatureModifier> featureModifiers) {
          final List<double[]> trainingInstances = new ArrayList<>();
          for (MLRecord record : data) {
              final double[] features = generateFeatureValues(record, featureModifiers);
              trainingInstances.add(features);
          }
          final double[][] x = trainingInstances.toArray(new double[trainingInstances.size()][]);
          return x;
      }
docs: Generates a matrix of feature values for each record.
  
  @param data
  @param featureModifiers
  @return