code: public LinearClassifier<L, F> trainClassifier(GeneralDataset<L, F> data) {
      labelIndex = data.labelIndex();
      featureIndex = data.featureIndex();
      double[][] weights = trainWeights(data);
      return new LinearClassifier<L, F>(weights, featureIndex, labelIndex);
    }
docs: Trains a {@link Classifier} on a {@link Dataset}.
  
  @return A {@link Classifier} trained on the data.