@Override
public Training constructTraining() {
if (options instanceof TrainOptionsImpl) {
TrainOptionsImpl trainOpts = (TrainOptionsImpl) options;
TrainingImpl trainingImpl = new TrainingImpl();
trainingImpl.setBuildLogisticModel(true);
if (trainOpts.useMinCost || trainOpts.useReweighting) {
trainingImpl.setUseCostTraining(true);
trainingImpl.setFalsePositiveCost(trainOpts.falsePositiveCost);
trainingImpl.setFalseNegativeCost(trainOpts.falseNegativeCost);
trainingImpl.setUseReweighting(trainOpts.useReweighting);
}
return trainingImpl;
} else {
throw new IllegalArgumentException("Options must be for Training");