1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| package org.houqian.jpmml;
import org.jpmml.evaluator.*; import org.xml.sax.SAXException;
import javax.xml.bind.JAXBException; import java.io.File; import java.io.IOException; import java.util.List;
public class Execute { public static void main(String[] args) throws JAXBException, SAXException, IOException { Evaluator evaluator = new LoadingModelEvaluatorBuilder() .setLocatable(false) .setVisitors(new DefaultVisitorBattery()) .load(new File("src/main/resources/pipeline.pmml.xml")) .build();
evaluator.verify();
List<? extends InputField> inputFields = evaluator.getInputFields(); System.out.println("Input fields: " + inputFields);
List<? extends TargetField> targetFields = evaluator.getTargetFields(); System.out.println("Target field(s): " + targetFields);
List<? extends OutputField> outputFields = evaluator.getOutputFields(); System.out.println("Output fields: " + outputFields);
evaluator = null; } }
|