code: public JComponent learn() {
          double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
  
          String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
          if (names[0] == null) {
              names = null;
          }
          
          int[] label = dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
          int min = Math.min(label);
          for (int i = 0; i < label.length; i++) {
              label[i] -= min;
          }
  
          long clock = System.currentTimeMillis();
          FLD lda = new FLD(data, label, Math.unique(label).length > 3 ? 3 : 2);
          System.out.format("Learn LDA from %d samples in %dms\n", data.length, System.currentTimeMillis()-clock);
  
          double[][] y = lda.project(data);
  
          PlotCanvas plot = new PlotCanvas(Math.colMin(y), Math.colMax(y));
          if (names != null) {
              plot.points(y, names);
          } else if (dataset[datasetIndex].responseAttribute() != null) {
              int[] labels = dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]);
              for (int i = 0; i < y.length; i++) {
                  plot.point(pointLegend, Palette.COLORS[labels[i]], y[i]);
              }
          } else {
              plot.points(y, pointLegend);
          }
  
          plot.setTitle("Linear Discriminant Analysis");
          return plot;
      }
docs: Execute the projection algorithm and return a swing JComponent representing
  the clusters.