SoftwareAG / nyoka

Nyoka is a Python library that helps to export ML models into PMML (PMML 4.4.1 Standard).
Apache License 2.0
184 stars 43 forks source link

SARIMAX exporter creates invalid PMML file #42

Closed alenhrga closed 3 years ago

alenhrga commented 4 years ago

I exported my SARIMAX model with latest Nyoka release (v4.3.0) and the resulting PMML file is created accordant to schema version 4.4. Exported PMML file had <InterceptVector> attribute which is not defined in schema version 4.4.

Part of the exported PMML file:

<?xml version="1.0" encoding="UTF-8"?>
<PMML xmlns="http://www.dmg.org/PMML-4_4" version="4.4">
    <Header copyright="Copyright (c) 2018 Software AG" description="State Space Model">
        <Application name="Nyoka" version="4.3.0"/>
        <Timestamp>2020-10-06 11:47:06.546081</Timestamp>
    </Header>
    <DataDictionary numberOfFields="2">
        <DataField name="SpotPriceEUR" optype="continuous" dataType="double"/>
        <DataField name="h" optype="continuous" dataType="integer"/>
    </DataDictionary>
...
...
    <MeasurementMatrix>
                <Matrix nbRows="1" nbCols="49">
                    <Array type="real">...</Array>
                </Matrix>
    </MeasurementMatrix>
    <InterceptVector>
        <Array n="49" type="real">...</Array>
     </InterceptVector>
        </StateSpaceModel>
    </TimeSeriesModel>
</PMML>

PMML 4.4 specification does not have <InterceptVector> attribute defined so this PMML file is actually invalid. According to PMML spec, <InterceptVector> attribute is defined in PMML version 4.4.1

Nirmal-Neel commented 3 years ago

Hi @alenhrga, Nyoka 4.3.0 is using an intermediate schema which lies between PMML schema 4.4 and 4.4.1. Now, as PMML schema 4.4.1 is out there, Nyoka will also be updated with the new schema which is already in progress. Thanks!

Sorry for the late reply!

Nirmal-Neel commented 3 years ago

Hi @alenhrga, Nyoka 4.4.0 has support for PMML schema 4.4.1. Check Release notes 4.4.0