/** * @return {@link PMML} with common {@link Header} fields like {@link Application}, * {@link Timestamp}, and version filled out */ public static PMML buildSkeletonPMML() { String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ", Locale.ENGLISH).format(new Date()); Header header = new Header() .setTimestamp(new Timestamp().addContent(formattedDate)) .setApplication(new Application("Oryx")); return new PMML(VERSION, header, null); }
/** * Create an instance of {@link PMML } * */ public PMML createPMML() { return new PMML(); }
/** * Create an instance of {@link PMML } * */ public PMML createPMML() { return new PMML(); }
/** * Quite manually write our fake model representation in PMML. */ private static void write(OutputStream out, ALSModelDescription model) throws JAXBException { PMML pmml = new PMML("4.2.1", null, null); for (Map.Entry<String,String> entry : model.getPathByKey().entrySet()) { Extension extension = new Extension(); extension.setName(entry.getKey()); extension.setValue(entry.getValue()); pmml.getExtensions().add(extension); } JAXBUtil.marshalPMML(pmml, new StreamResult(out)); }
/** * @return {@link PMML} with common {@link Header} fields like {@link Application}, * {@link Timestamp}, and version filled out */ public static PMML buildSkeletonPMML() { String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ", Locale.ENGLISH).format(new Date()); Header header = new Header() .setTimestamp(new Timestamp().addContent(formattedDate)) .setApplication(new Application("Oryx")); return new PMML(VERSION, header, null); }
public PMML build(BasicML basicML) { PMML pmml = new PMML();
static private PMML createPMML(){ Header header = new Header() .setCopyright("ACME Corporation"); DataDictionary dataDictionary = new DataDictionary(); PMML pmml = new PMML(Version.PMML_4_3.getVersion(), header, dataDictionary); return pmml; }
PMML pmml = new PMML();
@Test public void copyState(){ PMML pmml = new PMML(Version.PMML_4_3.getVersion(), new Header(), new DataDictionary()); // Initialize the live list instance pmml.getModels(); CustomPMML customPmml = new CustomPMML(); ReflectionUtil.copyState(pmml, customPmml); assertSame(pmml.getVersion(), customPmml.getVersion()); assertSame(pmml.getHeader(), customPmml.getHeader()); assertSame(pmml.getDataDictionary(), customPmml.getDataDictionary()); assertFalse(pmml.hasModels()); assertFalse(customPmml.hasModels()); pmml.addModels(new RegressionModel()); assertTrue(pmml.hasModels()); assertTrue(customPmml.hasModels()); assertSame(pmml.getModels(), customPmml.getModels()); try { ReflectionUtil.copyState(customPmml, pmml); fail(); } catch(IllegalArgumentException iae){ // Ignored } }
.setModelName("golfing"); PMML pmml = new PMML(Version.PMML_4_3.getVersion(), header, dataDictionary) .addModels(treeModel);
.setSplitCharacteristic(TreeModel.SplitCharacteristic.BINARY_SPLIT); PMML pmml = new PMML(Version.PMML_4_3.getVersion(), new Header(), new DataDictionary()) .addModels(treeModel);