autodeployai / pypmml

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

Incorrect defaultScore for RuleSet #32

Closed wf-r closed 3 years ago

wf-r commented 3 years ago

Description

When evaluating a RuleSet model, an incorrect defaultScore is returned when evaluating a combination that is not contained in the RuleSet.

How to reproduce

import pandas as pd
import pypmml

model = pypmml.Model.fromFile('./out.txt')
pred_data = model.predict(pd.DataFrame([[1, 3, 'B'], [2, 4, 'B']], columns=['A', 'B', 'C']))  # First row as contained in model, second some other row
assert (pred_data['predicted_T'] == pd.Series([1, 0])).all()  # 1 is score as defined by rule; 0 would be defaultScore, instead -9223372036854775808 is returned!

Environment

out.txt

scorebot commented 3 years ago

@wf-r Thanks for your info, this is a bug in the ruleset model, we will fix it as soon as possible.

scorebot commented 3 years ago

@wf-r We have fixed the issue. 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

Thanks for the quick fix, problem is fixed for me!