Converting between PMML versions

Hi All,

I would like to bring pmml models I created in IBM SPSS Modeler (pmml 4.0) into Knime but Knime is at version 4.2.   Are there any tools available to convert between pmml versions. 

Thanks.

Bart
 

KNIME should be able to read PMML 4.0 models.

I am having the same problem with SAP HANA Predictive Analysis Library / PAL, which I use to produce decision trees in PMML 4.0 format. I received the same error about KNIME working with 4.2.   To troubleshoot I used a text editor to change any version related information / command from 4.0 to 4.2.   That worked (although not a scalable option), but now I am getting other errors related to version differences.

WARN PMMLMiningSchemaTranslator MiningField "FUNCTION": Only "asIs" is supported for invalidValueTreatment. invalidValueTreatment="returnInvalid" is treated as "asIs".

Does anyone know if KNIME has an extension so that it can read PMML 4.0 files?  Clearly there is some compatibility problem here.

 

Hey Bart, were you ever able to solve this pmml version 4.0-4.2 problem?

Hi,

the invalid value treatment "returnInvalid" is not PMML 4.2 specific but currently not supported by KNIME. So this has nothing to do with the version number, because when KNIME imports a PMML document using the PMML Reader, it implicitely converts it to PMML 4.2. I think the only solution to get this running in KNIME is to change the invalid value treatment to "asIs". If you have no invalid values, this should change nothing. If you have them, you can still score your model with "asIs" and then replace all predictions that were made using invalid values with a suitable value.

Regards,

Alexander

Thanks Alexander, that worked!

hi

i can not use the PMML4.0 in knime

"is not a valid PMML 4.2 file"

I have a PMML Document of Version 4.0 exported from IBM SPSS modeller. I am trying to convert the model to SQL queries using the PMML to SQL node in Knime. But when i try to read the PMML document using PMML Reader, it shows the “not a valid PMML 4.2 file”. I changed the version name in PMML document. But it doesnt help. any solutions?

Hi,
It would help to see the PMML, but one thing I came across before is scientific notation in the importance attributes in the Mining Schema. Scientific notation is not allowed here according to the PMML standard. If you can confirm that this is the problem, I can provide you with a workflow that fixes the PMML.
Kind regards
Alexander

Hi Alexander,

Thanks for the reply. I don’t have scientific notations in the PMML document. I’ve attached the PMML document that i am using. Sorry, for specific reasons, i have encoded the data in PMML which I cannot share. Please can you see if its a valid PMML 4.2 Document?PMML_Sample.xml (2.5 MB)

Hi,
The fifth Mining Field’s importance attribute in your document contains a number in scientific notation: <MiningField importance="XXX.17942446972167E-XXX" name="XXX" usageType="XXX"/>. This is not according to PMML standard, where the importance attribute is of type decimal, which must not be given in scientific notation.
Kind regards
Alexander

4 Likes

Hi Alexander - Thanks for the reply. This is the warning throwing up while loading the PMML file in PMML Reader Node after removing the scientific notations -<LiftData targetFieldValue=“1” targetFieldV[…] :Expected element ‘ROC’ insted of “LiftData” here in element PredictiveModel Qulaity. and Expected elements ‘SimplePredicate CompoundPredicate SimpleSet Predicate True False’ before the end of content in element CompoundPredicatePMML_sample.xml (2.5 MB)

Hi Alexander - Did u get chance to look into this?

Hi,
No, since I am on vacation right now I could not look into it yet. But to me it seems like SPSS simply outputs invalid PMML. I will have another look next week, when I am back in the office.
Kind regards
Alexander

Hi,
unfortunately the document is too large to search it by hand and it cannot be parsed due to the obfuscation, so it is hard for me to find out what is wrong. Would you be ok with sending me the complete PMML via private message? If so, let me know and I will initiate a private conversation.
What I can say for sure, though, is that the document contains quite a few elements. Those contain non-standard PMML and may cause KNIME to produce different results than SPSS, since only SPSS can understand it.
Kind regards
Alexander

1 Like