public void trainC(ClassificationDataSet dataSet, ExecutorService threadPool) {
    if (dataSet.getClassSize() != 2)
      throw new FailedToFitException(
          "Logistic Regression works only in the case of two classes, and can not handle "
              + dataSet.getClassSize()
              + " classes");
    RegressionDataSet rds =
        new RegressionDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories());
    for (int i = 0; i < dataSet.getSampleSize(); i++) {
      // getDataPointCategory will return either 0 or 1, so it works perfectly
      rds.addDataPoint(dataSet.getDataPoint(i), (double) dataSet.getDataPointCategory(i));
    }

    train(rds, threadPool);
  }