new RegressionFlowExample().run();
}
public void run() throws IOException
{
Tap irisTap = new FileTap( new TextDelimited( true, "\t", "\"" ), "data/iris.lm_p.tsv", SinkMode.KEEP );
Tap resultsTap = new FileTap( new TextDelimited( true, "\t", "\"" ), "build/test/output/flow/results.tsv", SinkMode.REPLACE );
FlowDef flowDef = FlowDef.flowDef()
.setName( "pmml flow" )
.addSource( "iris", irisTap )
.addSink( "results", resultsTap );
PMMLPlanner pmmlPlanner = new PMMLPlanner()
.setPMMLInput( new File( "data/iris.lm_p.xml" ) )
.retainOnlyActiveIncomingFields();
flowDef.addAssemblyPlanner( pmmlPlanner );
Flow flow = new LocalFlowConnector().connect( flowDef );
flow.complete();
TupleEntryIterator iterator = resultsTap.openForRead( flow.getFlowProcess() );
while( iterator.hasNext() )
System.out.println( iterator.next() );
iterator.close();