本文整理汇总了Java中org.jpmml.model.PMMLUtil类的典型用法代码示例。如果您正苦于以下问题:Java PMMLUtil类的具体用法?Java PMMLUtil怎么用?Java PMMLUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PMMLUtil类属于org.jpmml.model包,在下文中一共展示了PMMLUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
/**
* @param pmml {@link PMML} model to write
* @param out stream to write the model to
* @throws IOException if an error occurs while writing the model to storage
*/
public static void write(PMML pmml, OutputStream out) throws IOException {
try {
PMMLUtil.marshal(pmml, out);
} catch (JAXBException e) {
throw new IOException(e);
}
}
示例2: read
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
/**
* @param in stream to read PMML from
* @return {@link PMML} model file from stream
* @throws IOException if an error occurs while reading the model from the stream
*/
public static PMML read(InputStream in) throws IOException {
try {
return PMMLUtil.unmarshal(in);
} catch (JAXBException | SAXException e) {
throw new IOException(e);
}
}
示例3: run
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
private void run() throws Exception {
PMML pmml;
try(InputStream is = new FileInputStream(this.input)){
pmml = PMMLUtil.unmarshal(is);
}
pmml = enhance(pmml);
try(OutputStream os = new FileOutputStream(this.output)){
MetroJAXBUtil.marshalPMML(pmml, os);
}
}
示例4: createModelEvaluator
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
static
public ModelEvaluator<?> createModelEvaluator(InputStream is, ModelEvaluatorFactory modelEvaluatorFactory) throws Exception {
PMML pmml = PMMLUtil.unmarshal(is);
assertNull(pmml.getLocator());
return modelEvaluatorFactory.newModelEvaluator(pmml);
}
示例5: readPMML
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
static
public PMML readPMML(File file) throws Exception {
try(InputStream is = new FileInputStream(file)){
return PMMLUtil.unmarshal(is);
}
}
示例6: writePMML
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
static
public void writePMML(PMML pmml, File file) throws Exception {
try(OutputStream os = new FileOutputStream(file)){
PMMLUtil.marshal(pmml, os);
}
}
示例7: loadPMML
import org.jpmml.model.PMMLUtil; //导入依赖的package包/类
protected PMML loadPMML(String path) throws Exception {
try(InputStream is = open(path)){
return PMMLUtil.unmarshal(is);
}
}