I'm currently attempting to build module for the Knime analytics platform. This is going to be a module that generates and passes on a PMML model as its output.
So far I've only been able to accomplish this by manually creating a PMMLDocument and then creating a new PMMLPortObject((PMMLPortObjectSpec)out_spec, pmmlDoc) to return.
My question is whether creating the pmml doc itself manually is the right approach here, or is there any other more streamlined method to do this, maybe via templating or something similar ?
Currently, generating a pmml model manually like so:
PMMLDocument resDoc = PMMLDocument.Factory.newInstance();
PMML pmml = PMML.Factory.newInstance();
pmml.setVersion("4.2");
Header header = pmml.addNewHeader();
header.setCopyright("some custom made copyright");
Application application = header.addNewApplication();
application.setName("KNIME");
application.setVersion("2.10.3");
...
Can get quite tedious and it makes me wonder where this is actually a best practice or not