'Downgrading PMML 4.4 to 4.3 version

I am trying to convert my sckit-learn model to PMML 4.3 using sklearn2pmml. I did it successfully for the version 4.4 however I need the PMML 4.3 and therefore I decided to install the version 0.56 for sklearn2pmml using the following commands:

pip install sklearn2pmml=0.56

However now when I try to create a pipeline I receive the following error:

Pipe_PMML = PMMLPipeline([('scaler', StandardScaler()),('classifier', LogisticRegression())])
 AttributeError: 'PMMLPipeline' object has no attribute 'apply_transformer'

The newest version of sklearn2pmml is 0.76 and solve this issue but generates the PMML version 4.4. I was wondering how the previous versions used to convert the ML models in Python to PMML. Is there any way to downgrade the 4.4 version to older version?



Solution 1:[1]

Downgrading sklearn to 0.23.2 solved the problem for me.

Solution 2:[2]

First, export your pipeline using Sklearn2PMML 0.76. Second, export your pipeline using SkLearn2PMML 0.56.

Now, take a "diff" of these two files - what are the changes? The XML namespace declaration and the value of the PMML@version attribute should differ, but anything else?

Once you know/understand the difference between 4.4 and 4.3 markup in your pipeline's case, write your own "downgrade" tool (or do it manually, if it's a one-time assignment).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pramod Gupta
Solution 2