iterativeStageComplete();
return;
}
LOG.debug("Started BuildIterationalClassifier");
Map<Integer, List<Object>> nominalValues = getNominalValues();
TupleListIterator tuples = new FullListTupleListIterator(INPUT_DATA, mDataInput);
TupleMetadata metadata = (TupleMetadata)tuples.getMetadataWrapper().getMetadata();
columns = "Trained on: [";
for(int i=0; i<metadata.getColumnCount();i++)
columns += metadata.getColumnMetadata(i).getName() + " ";
columns += "]\n";
Instances dataset = WekaUtilities.createEmptyDataset(metadata, classIndex, nominalValues);
if(mOptionsInput != null)
description = TupleUtilities.getString(readBlock(mDescriptionInput), INPUT_DESCRIPTION);
else
description = "";
HoeffdingTree tree = new HoeffdingTree();
String options;
try
{
if(mOptionsInput != null)
options = TupleUtilities.getMoaOptions(readBlock(mOptionsInput));
else
options = DEFAULT_OPTIONS;
}
catch (Exception e)
{
throw new ActivityUserException(e);
}
try
{
Tuple tuple;
tree.getOptions().setViaCLIString(options);
tree.prepareForUse();
Calendar cal = Calendar.getInstance();
this.startTime = cal.getTimeInMillis();
if(mSummaryOutput != null) {
mSummaryOutput.write(ControlBlock.LIST_BEGIN);
}
while((tuple = (Tuple)tuples.nextValue()) != null && tuple != ControlBlock.LIST_END) {
Instance inst = WekaUtilities.createInstance(dataset, tuple);
tree.trainOnInstance(inst);
if(stepCounter == 0) {
writeOutput(new TupleClassifier(tree, WekaUtilities.getAttributes(dataset), classIndex));