当前位置: 首页>>代码示例>>Java>>正文


Java PMML.accept方法代码示例

本文整理汇总了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);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:27,代码来源:MixedContentTest.java

示例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);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:21,代码来源:SerializationTest.java

示例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);
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:21,代码来源:SerializationTest.java

示例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());
	}
}
 
开发者ID:jpmml,项目名称:jpmml-model,代码行数:25,代码来源:SerializationTest.java

示例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;
}
 
开发者ID:jpmml,项目名称:jpmml-storm,代码行数:17,代码来源:PMMLBoltUtil.java


注:本文中的org.dmg.pmml.PMML.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。