本文整理汇总了Java中org.dmg.pmml.PMML.accept方法的典型用法代码示例。如果您正苦于以下问题:Java PMML.accept方法的具体用法?Java PMML.accept怎么用?Java PMML.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dmg.pmml.PMML
的用法示例。
在下文中一共展示了PMML.accept方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mixedContent
import org.dmg.pmml.PMML; //导入方法依赖的package包/类
@Test
public void mixedContent() throws Exception {
PMML pmml = ResourceUtil.unmarshal(getClass());
List<?> content = ExtensionUtil.getContent(pmml);
assertEquals(5, content.size());
assertEquals("First text value", content.get(0));
assertEquals(Arrays.asList("First extension"), getDeepContent(content.get(1)));
assertEquals("Second text value", content.get(2));
assertEquals(Arrays.asList("Second extension"), getDeepContent(content.get(3)));
assertEquals("Third text value", content.get(4));
try {
SerializationUtil.clone(pmml);
fail();
} catch(NotSerializableException nse){
// Ignored
}
pmml.accept(new LocatorTransformer());
SerializationUtil.clone(pmml);
}
示例2: nullifyAndClone
import org.dmg.pmml.PMML; //导入方法依赖的package包/类
@Test
public void nullifyAndClone() throws Exception {
PMML pmml = ResourceUtil.unmarshal(Version.PMML_4_3);
assertNotNull(pmml.getLocator());
try {
SerializationUtil.clone(pmml);
fail();
} catch(NotSerializableException nse){
// Ignored
}
pmml.accept(new LocatorNullifier());
assertNull(pmml.getLocator());
SerializationUtil.clone(pmml);
}
示例3: transformAndClone
import org.dmg.pmml.PMML; //导入方法依赖的package包/类
@Test
public void transformAndClone() throws Exception {
PMML pmml = ResourceUtil.unmarshal(Version.PMML_4_3);
assertNotNull(pmml.getLocator());
try {
SerializationUtil.clone(pmml);
fail();
} catch(NotSerializableException nse){
// Ignored
}
pmml.accept(new LocatorTransformer());
assertNotNull(pmml.getLocator());
SerializationUtil.clone(pmml);
}
示例4: compressedSequence
import org.dmg.pmml.PMML; //导入方法依赖的package包/类
@Test
public void compressedSequence() throws Exception {
PMML pmml = ResourceUtil.unmarshal(Version.PMML_4_3);
pmml.accept(new LocatorNullifier());
DirectByteArrayOutputStream buffer = new DirectByteArrayOutputStream(3 * 1024);
try(OutputStream os = new GZIPOutputStream(buffer)){
SerializationUtil.serializePMML(pmml, os);
SerializationUtil.serializePMML(pmml, os);
os.flush();
}
try(InputStream is = new GZIPInputStream(buffer.getInputStream())){
PMML firstPmml = SerializationUtil.deserializePMML(is);
PMML secondPmml = SerializationUtil.deserializePMML(is);
assertNotSame(firstPmml, secondPmml);
assertEquals(-1, is.read());
}
}
示例5: createEvaluator
import org.dmg.pmml.PMML; //导入方法依赖的package包/类
static
public Evaluator createEvaluator(InputStream is) throws SAXException, JAXBException {
Source source = ImportFilter.apply(new InputSource(is));
PMML pmml = JAXBUtil.unmarshalPMML(source);
// If the SAX Locator information is available, then transform it to java.io.Serializable representation
LocatorTransformer locatorTransformer = new LocatorTransformer();
pmml.accept(locatorTransformer);
ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
ModelEvaluator<?> modelEvaluator = modelEvaluatorFactory.newModelManager(pmml);
return modelEvaluator;
}