本文整理匯總了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);
}
}