SQLQuery query = new SQLQuery();
query.setResourceID(resource);
query.addExpression("SELECT temperature, humidity, outlook, windy, weather.play FROM weather JOIN measurements ON weather.id = measurements.id");
workflow.add(query);
ListRandomSplit split = new ListRandomSplit();
split.setNumberOfOutputs(count);
split.connectDataInput(query.getDataOutput());
workflow.add(split);
TupleUnionAll[] union = new TupleUnionAll[count];
Evaluate[] evaluate = new Evaluate[count];
SprintClassifier[] classifier = new SprintClassifier[count];
for (int i=0; i<count; i++)
{
union[i] = new TupleUnionAll();
union[i].setNumberOfInputs(count-1);
for (int j=0; j<i; j++)
{
union[i].connectDataInput(j, split.getOutput(j));
}
for (int j=i+1; j<count; j++)
{
union[i].connectDataInput(j-1, split.getOutput(j));
}
workflow.add(union[i]);
classifier[i] = new SprintClassifier();
classifier[i].addClassName("play");
classifier[i].addClassValues(new String[] {"yes", "no"});
classifier[i].connectDataInput(union[i].getDataOutput());
DeliverToRequestStatus deliverDT = new DeliverToRequestStatus();
deliverDT.connectInput(classifier[i].getResultOutput());
evaluate[i] = new Evaluate();
evaluate[i].connectPMMLTreeInput(classifier[i].getResultOutput());
evaluate[i].connectDataInput(split.getOutput(i));
DeliverToRequestStatus deliverEval = new DeliverToRequestStatus();
deliverEval.connectInput(evaluate[i].getResultOutput());
workflow.add(classifier[i]);