* @return The trainer.
*/
private MLTrain createTrainer(final MLMethod method,
final MLDataSet trainingSet) {
final MLTrainFactory factory = new MLTrainFactory();
final String type = getProp().getPropertyString(
ScriptProperties.ML_TRAIN_TYPE);
final String args = getProp().getPropertyString(
ScriptProperties.ML_TRAIN_ARGUMENTS);
EncogLogging.log(EncogLogging.LEVEL_DEBUG, "training type:" + type);
EncogLogging.log(EncogLogging.LEVEL_DEBUG, "training args:" + args);
if( method instanceof MLResettable ) {
this.getAnalyst().setMethod(method);
}
MLTrain train = factory.create(method, trainingSet, type, args);
if ( getKfold() > 0) {
train = new CrossValidationKFold(train, getKfold() );
}