autodeployai / pypmml

Python PMML scoring library
Apache License 2.0
76 stars 22 forks source link

Is InvalidValueReplacement working? #33

Closed wf-r closed 3 years ago

wf-r commented 3 years ago

Hi,

in the following model, I would assume that InvalidValueReplacement should yield a result different from the one currently produced by PyPmml. Could you have a look at it?

How to reproduce:

import pandas as pd
import pypmml

model = pypmml.Model.fromFile('./out.txt')
pred_data = model.predict(pd.DataFrame([['c'], ['d']], columns=['C']))
assert (pred_data['predicted_T'] == pd.Series([1, 1])).all()  # Value 'd' should be invalid, thus being replaced by 'c'

out.txt

System:

Thank you! Wolfgang

scorebot commented 3 years ago

@wf-r Thanks for your info, it is a bug of PMML4S handling the invalid value. I have fixed it. Please, reinstall the latest version from Github by the following command:

pip install --upgrade git+https://github.com/autodeployai/pypmml.git

Please, let me know if you still have a problem.

wf-r commented 3 years ago

Great, thanks for the quick fix!