service = args[0];
}
SQLQuery query = new SQLQuery();
query.setResourceID("MySQLResource");
query.addExpression("SELECT temperature, humidity, outlook, windy, weather.play FROM weather JOIN measurements ON weather.id = measurements.id");
SprintClassifier classifier = new SprintClassifier();
classifier.addClassName("play");
classifier.addClassValues(new String[] {"yes", "no"});
classifier.connectDataInput(query.getDataOutput());
Evaluate evaluate = new Evaluate();
evaluate.connectPMMLTreeInput(classifier.getResultOutput());
evaluate.connectDataInput(query.getDataOutput());
DeliverToRequestStatus deliverDT = new DeliverToRequestStatus();
deliverDT.connectInput(classifier.getResultOutput());
DeliverToRequestStatus deliverEval = new DeliverToRequestStatus();
deliverEval.connectInput(evaluate.getResultOutput());
PipelineWorkflow workflow = new PipelineWorkflow();
workflow.add(query);
workflow.add(classifier);
workflow.add(evaluate);
workflow.add(deliverDT);
workflow.add(deliverEval);
new Execute(service).execute(workflow);
System.out.println(" ---- Decision tree: ---- ");
System.out.println(classifier.nextResult());
System.out.println("\n\n ---- Evaluation result: ---- ");
System.out.println(evaluate.nextResult());
}