iterativeStageComplete();
return;
}
LOG.debug("Started BuildClassifier");
TupleListIterator tuples = new FullListTupleListIterator(INPUT_DATA, mDataInput);
TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
int classIndex = getClassIndex(classIndexBlock, metadata);
Map<Integer, List<Object>> nominalValues = getNominalValues(metadata);
Instances dataset = WekaUtilities.createClassificationDataset(tuples, classIndex, nominalValues);
String options;
if(mOptionsInput != null)
options = TupleUtilities.getWekaOptions(readBlock(mOptionsInput));
else
options = DEFAULT_OPTIONS;
if(mAlgorithmClassInput != null)
mAlgorithmClass = TupleUtilities.getString(readBlock(mAlgorithmClassInput), INPUT_ALGORITHM_CLASS);
else
mAlgorithmClass = mClassifierName;
LOG.debug("WEKA options = " + options);
LOG.debug("Classifier class name = " + mAlgorithmClass);
Classifier classifier;
try
{
classifier = loadClassifier(options);
classifier.buildClassifier(dataset);
if(mSummaryOutput != null)
{
StringBuilder columns = new StringBuilder();
columns.append("Trained on: [");
for(int i=0; i<metadata.getColumnCount(); i++)
{
columns.append(metadata.getColumnMetadata(i).getName());
columns.append(" ");
}
columns.append("]\n");
mSummaryOutput.write(ControlBlock.LIST_BEGIN);
String description = "";