jpmml / jpmml-converter

Java library for authoring PMML
GNU Affero General Public License v3.0
15 stars 4 forks source link

PMML version in xmlns tag does not match version tag #18

Closed tristanlmiller closed 4 years ago

tristanlmiller commented 4 years ago

The pmml files generated by sklearn2pmml appear to have a version discrepancy in the header. Here's a header of a pmml file that I just generated

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PMML xmlns="http://www.dmg.org/PMML-4_4" xmlns:data="http://jpmml.org/jpmml-model/InlineTable" version="4.3">
    <Header>
        <Application name="JPMML-SkLearn" version="1.6.3"/>
        <Timestamp>2020-07-27T18:08:57Z</Timestamp>

Note the discrepancy between PMML-4_4 and version 4.3. Compare to the header of an older pmml file we generated a month ago:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PMML xmlns="http://www.dmg.org/PMML-4_3" xmlns:data="http://jpmml.org/jpmml-model/InlineTable" version="4.3">
    <Header>
        <Application name="JPMML-SkLearn" version="1.5.35"/>
        <Timestamp>2020-06-15T20:11:06Z</Timestamp>

I don't know what versions we were using last month, but I'm currently using sklearn2pmml version 0.60.0. The java version is:

openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)

The problem is easy to fix for our purposes, but I thought I'd inform you of the bug.

vruusmann commented 4 years ago

Noted.

The offending line in the JPMML-Converter library: https://github.com/jpmml/jpmml-converter/blob/1.4.2/src/main/java/org/jpmml/converter/PMMLEncoder.java#L86

Should be using an org.dmg.pmml.Version enum constant there, not a string.